Skip to content

Instantly share code, notes, and snippets.

View ZoolWay's full-sized avatar

Ricky Blankenaufulland ZoolWay

View GitHub Profile
@ZoolWay
ZoolWay / camelize.ts
Created May 17, 2016 09:16
TypeScript variant of camelize.js
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()});
}
@ZoolWay
ZoolWay / camelize.js
Last active May 17, 2016 09:15 — forked from vjt/camelize.js
String.camelize
// I thought I needed it, but I didn't need it anymore,
// but I already implemented it. So, here we go, if you
// ever would need a Javascript camelize implementation
// you can freely use this :-).
// - vjt@openssl.it Tue Feb 15 16:49:52 CET 2011
jQuery.extend (String.prototype, {
camelize: function () {
return s.replace(/(?:^|[-_])(\w)/g, function (stripped, letter) {