ramda-extension
ramda-extension copied to clipboard
toSnakeCase function is broken when converting from camelCase
Describe the bug Using the snake case function on a camel cased string does not properly convert the string:
> R_.toSnakeCase('fooBar') //=> 'foobar'
To Reproduce https://ramda-extension.firebaseapp.com/repl/?v=%5E0.26.1&ve=0.10.1#?R_.toSnakeCase%28%27fooBar%27%29
Expected behavior It should properly convert the string:
> R_.toSnakeCase('fooBar') //=> 'foo_bar'
Additional context N/A
woking on it
Any updates?
@KarinaDrummer @tommmyy Finally got around to addressing this: https://github.com/tommmyy/ramda-extension/pull/182. :) Open to discussion on the implementation and potential edge cases here. That regex was tricky to put together. ;)
Cool, hope I'll have a time to join the discussion
Any update on when this might get merged/fixed? Thanks :)
Also, another handy thing would be to have the compliment of camelizeKeys
so snakeCaseKeys
or snakizeKeys
. Having these two things would make it easy for talking to backends that do snake case. Can open another issue if there is interest in that.