We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b2929a commit 14ee9e7Copy full SHA for 14ee9e7
src/shared/util.js
@@ -157,12 +157,9 @@ export const capitalize = cached((str: string): string => {
157
/**
158
* Hyphenate a camelCase string.
159
*/
160
-const hyphenateRE = /([^-])([A-Z])/g
+const hyphenateRE = /\B([A-Z])/g
161
export const hyphenate = cached((str: string): string => {
162
- return str
163
- .replace(hyphenateRE, '$1-$2')
164
165
- .toLowerCase()
+ return str.replace(hyphenateRE, '-$1').toLowerCase()
166
})
167
168
0 commit comments