Created
May 17, 2016 09:16
-
-
Save ZoolWay/3a6ed3b5f8c6ddf0a77b112f22821d17 to your computer and use it in GitHub Desktop.
TypeScript variant of camelize.js
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
private static camelize(s: string): string { | |
return s.replace(/(?:^|[-_])(\w)/g, function (stripped, letter) { | |
return letter ? letter.toUpperCase () : ''; | |
}).replace(/(^\w)/, function(letter) { return letter.toLowerCase()}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment