Skip to content

Commit 06ca85d

Browse files
committed
port hyphenate fix
1 parent 5b668a9 commit 06ca85d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shared/util.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,10 @@ export const capitalize = cached((str: string): string => {
9999
/**
100100
* Hyphenate a camelCase string.
101101
*/
102-
const hyphenateRE = /([a-z\d])([A-Z])/g
102+
const hyphenateRE = /([^-])([A-Z])/g
103103
export const hyphenate = cached((str: string): string => {
104104
return str
105+
.replace(hyphenateRE, '$1-$2')
105106
.replace(hyphenateRE, '$1-$2')
106107
.toLowerCase()
107108
})

0 commit comments

Comments
 (0)