ran npm run tdd & generated TDD
This commit is contained in:
5
test/fromCamelCase/fromCamelCase.js
Normal file
5
test/fromCamelCase/fromCamelCase.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = (str, separator = '_') =>
|
||||
str
|
||||
.replace(/([a-z\d])([A-Z])/g, '$1' + separator + '$2')
|
||||
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + separator + '$2')
|
||||
.toLowerCase();
|
||||
Reference in New Issue
Block a user