We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7047abf commit 931a709Copy full SHA for 931a709
lib/util.js
@@ -2,7 +2,7 @@
2
* rules:
3
* - abc-def -> abcDef
4
* - -abc-def -> AbcDef
5
- *
+ *
6
* @param {string} value
7
* @return {string}
8
*/
@@ -16,12 +16,15 @@ exports.hyphenedToCamelCase = function hyphenedToCamelCase(value) {
16
17
* - abcDef -> abc-def
18
* - AbcDef -> -abc-def
19
20
21
22
23
exports.camelCaseToHyphened = function camelCaseToHyphened(value) {
24
return value.replace(/([A-Z])/g, function(s, m) {
25
- return '-' + m.toLowerCase()
+ if (typeof m === 'string') {
26
+ return '-' + m.toLowerCase()
27
+ }
28
+ return m
29
})
30
}
0 commit comments