underscore.string
underscore.string copied to clipboard
Alias underscored() to decamelize()
I believe there are people looking for fooBar -> foo_bar searching for a function called decamelize() as with decapitalize() . This could be a useful alias for underscored() .
From a decamelize
I would expect the API to be something like decamelize(string, [separator="_"])
.
underscored
doesn't take a separator and it would make no sense to change the API of underscored
to take on. So in my opinion decamelize
could be a new function but not an alias. If we create decamelize
we should change dasherize
humanize
and underscored
to use dasherize
.
@stoeffel when you refer to the changes of dasherize humanize and underscored to use dasherize do you mean to use decamelize?