Skip to content

Instantly share code, notes, and snippets.

@EQuimper
Created July 6, 2020 15:00
Show Gist options
  • Save EQuimper/219cb0eb95084bb1501989458bd8927a to your computer and use it in GitHub Desktop.
Save EQuimper/219cb0eb95084bb1501989458bd8927a to your computer and use it in GitHub Desktop.
export const toCamel = (value: string): string => (
value.replace(/([-_][a-z])/ig, ($1) => $1.toUpperCase()
.replace("-", "")
.replace("_", ""))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment