Created
October 24, 2016 17:10
-
-
Save raduGaspar/9d9e9d5001ab01d0ba37dd317a9a97d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Utils { | |
constructor() { | |
let e = new Error('is a static class, no need to instantiate!'); | |
e.name = 'Utils'; | |
throw e.toString(); | |
} | |
static toCamelCase(str) { | |
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(letter, index) { | |
return index == 0 ? letter.toLowerCase() : letter.toUpperCase(); | |
}).replace(/(\s|-|_)+/g, ''); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment