Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/shared/util.js
Original file line number Diff line number Diff line change
@@ -157,12 +157,9 @@ export const capitalize = cached((str: string): string => {
/**
* Hyphenate a camelCase string.
*/
const hyphenateRE = /([^-])([A-Z])/g
const hyphenateRE = /\B([A-Z])/g
export const hyphenate = cached((str: string): string => {
return str
.replace(hyphenateRE, '$1-$2')
.replace(hyphenateRE, '$1-$2')
.toLowerCase()
return str.replace(hyphenateRE, '-$1').toLowerCase()
})

/**

0 comments on commit 14ee9e7

Please sign in to comment.