helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

{{camelcase}} helper does not camelCase without space in the string #363

Open matthieu-sofa opened 4 years ago

matthieu-sofa commented 4 years ago

Note: Jon asked me to put this here after I reached out to him via mail. Because it seems to be a bug.

I'm reaching out to you to ask you a quick question about handlebars-helpers (awesome package by way, thanks a lot).

I want to transform a basic string "PascalCase" into camel case => "pascalCase"

I tried to use the {{camelcase}} helper (here https://www.npmjs.com/package/handlebars-helpers#camelcase)

but unfortunately it transforms a string into camel case string only if words in the string are separated by a space caracter :

Example

{{camelcase "foo bar baz"}};

Do you know what can be a workaround for this to get :

Example

{{camelcase "FooBarBaz"}};

Thanks a lot for your help.

matthieu-sofa commented 4 years ago

Seems to be the same issue as this one : https://github.com/helpers/handlebars-helpers/issues/259