Skip to content

Instantly share code, notes, and snippets.

@JavaScript-Packer
Created July 24, 2015 10:02
Show Gist options
  • Select an option

  • Save JavaScript-Packer/71c10fe7bb51186e1a0e to your computer and use it in GitHub Desktop.

Select an option

Save JavaScript-Packer/71c10fe7bb51186e1a0e to your computer and use it in GitHub Desktop.
Camelize
function camelize(e) {
return e.replace(/\W+(.)/g, function(e, t) {
return t.toUpperCase();
});
}
function uncamelize(e, t) {
return e.replace(/([a-z\d])([A-Z])/g, "$1" + (t || " ") + "$2");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment