Skip to content

Instantly share code, notes, and snippets.

@henhal
Created May 23, 2019 06:39
Show Gist options
  • Save henhal/90bbf9524bf3abc5cacc751810d49136 to your computer and use it in GitHub Desktop.
Save henhal/90bbf9524bf3abc5cacc751810d49136 to your computer and use it in GitHub Desktop.
Convert ALL_CAPS to camelCase
const allCaps2CamelCase = s => s.toLowerCase().replace(/(_.?)/g, ([,c]) => c ? c.toUpperCase() : '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment