Skip to content

Commit

Permalink
Merge pull request #36 from vanodevium/dash-bug
Browse files Browse the repository at this point in the history
dash-case: bug with uppercase first letter
  • Loading branch information
dy authored Jul 14, 2024
2 parents 319bdce + 3e48f85 commit b69c3c4
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion directive/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,5 @@ const debounce = (fn, wait) => {
};

export const dashcase = (str) => {
return str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (match) => "-" + match.toLowerCase());
return str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (match, i) => (i?'-':'') + match.toLowerCase());
}
2 changes: 1 addition & 1 deletion dist/sprae.auto.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ ${dir}${expr ? `="${expr}"
};
};
var dashcase = (str) => {
return str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (match) => "-" + match.toLowerCase());
return str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (match, i) => (i ? "-" : "") + match.toLowerCase());
};

// directive/value.js
Expand Down
4 changes: 2 additions & 2 deletions dist/sprae.auto.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprae.auto.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/sprae.auto.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/sprae.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ var debounce = (fn, wait) => {
};
};
var dashcase = (str) => {
return str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (match) => "-" + match.toLowerCase());
return str.replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g, (match, i) => (i ? "-" : "") + match.toLowerCase());
};

// directive/value.js
Expand Down
4 changes: 2 additions & 2 deletions dist/sprae.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit b69c3c4

Please sign in to comment.