Skip to content

Instantly share code, notes, and snippets.

@bobmacneal
Created February 17, 2020 20:05
Show Gist options
  • Save bobmacneal/e46cb043ec72ebd671e5828bb9ba242f to your computer and use it in GitHub Desktop.
Save bobmacneal/e46cb043ec72ebd671e5828bb9ba242f to your computer and use it in GitHub Desktop.
export const camelCaseToSnakeCase = (item) => {
return item.replace(/[\w]([A-Z])/g, (m) => {
return m[0] + '_' + m[1]
}).toLowerCase()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment