Skip to content

Commit

Permalink
feat: build
Browse files Browse the repository at this point in the history
  • Loading branch information
shiliuzi8686 committed Dec 10, 2024
1 parent 21d2ed5 commit 2289124
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 6 additions & 1 deletion cdn/radash.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,12 @@ const pascal = (str) => {
const title = (str) => {
if (!str)
return "";
return str.split(/(?=[A-Z])|[\.\-\s_]/).map((s) => s.trim()).filter((s) => !!s).map((s) => capitalize(s.toLowerCase())).join(" ");
return str.split(/(?=[A-Z][a-z])|[\.\-\s_]/).map((s) => s.trim()).filter((s) => !!s).map((s) => {
if (s === s.toUpperCase()) {
return capitalize(s.toLowerCase());
}
return capitalize(s);
}).join(" ");
};
const template = (str, data, regex = /\{\{(.+?)\}\}/g) => {
return Array.from(str.matchAll(regex)).reduce((acc, match) => {
Expand Down
7 changes: 6 additions & 1 deletion cdn/radash.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,12 @@ var radash = (function (exports) {
const title = (str) => {
if (!str)
return "";
return str.split(/(?=[A-Z])|[\.\-\s_]/).map((s) => s.trim()).filter((s) => !!s).map((s) => capitalize(s.toLowerCase())).join(" ");
return str.split(/(?=[A-Z][a-z])|[\.\-\s_]/).map((s) => s.trim()).filter((s) => !!s).map((s) => {
if (s === s.toUpperCase()) {
return capitalize(s.toLowerCase());
}
return capitalize(s);
}).join(" ");
};
const template = (str, data, regex = /\{\{(.+?)\}\}/g) => {
return Array.from(str.matchAll(regex)).reduce((acc, match) => {
Expand Down
Loading

0 comments on commit 2289124

Please sign in to comment.