9 lines
222 B
JavaScript
9 lines
222 B
JavaScript
var hyphen2camel = function (str) {
|
|
return str
|
|
.toLowerCase()
|
|
.replace(/-[a-z]/g, function (match) {
|
|
return match.slice(1).toUpperCase() ;
|
|
});
|
|
};
|
|
|
|
module.exports = hyphen2camel; |