underscore.string icon indicating copy to clipboard operation
underscore.string copied to clipboard

Alias underscored() to decamelize()

Open jamiel opened this issue 10 years ago • 2 comments

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() .

jamiel avatar Feb 16 '15 11:02 jamiel

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 avatar Feb 16 '15 13:02 stoeffel

@stoeffel when you refer to the changes of dasherize humanize and underscored to use dasherize do you mean to use decamelize?

dgolman avatar Dec 17 '15 18:12 dgolman