snake
Convert a string to snake case
441 bytes
Usage
Given a string returns it in snake case format.
Warning: In v11.0.0 a change was made to fix this function so that it correctly splits numbers from neighboring letters (hello5
becomes hello_5
). You can opt out of this behavior and continue with the legacy style (hello5
becomes hello5
) by passing the splitOnNumber
options.