Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to join with an empty string separator #294

Open
sambrenner opened this issue Oct 5, 2017 · 1 comment
Open

Unable to join with an empty string separator #294

sambrenner opened this issue Oct 5, 2017 · 1 comment

Comments

@sambrenner
Copy link

The join helper checks to make sure that the supplied separator is a string using isString in the handlebars-utils repo. Because isString also makes sure the supplied string is non-empty, this means that I am unable to use an empty string separator in a join block.

i.e. I would expect that this handlebars

{{join myArray ""}}

would produce

item1item2item3

when in fact it produces

item1, item2, item3

Source for this repo: https://github.com/helpers/handlebars-helpers/blob/master/lib/array.js#L297
Source for utils repo: https://github.com/helpers/handlebars-utils/blob/master/index.js#L490

Personally I think a function called isString shouldn't care whether the string is empty or not, but since this is the documented behavior of the function in handlebars-utils library, I've opened the issue here.

@jonschlinkert
Copy link
Member

Hmm, I think we should check for an empty string, instead of undefined (assuming this is what it's checking for now) and do what you're describing. thanks for the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants