handlebars-helpers
handlebars-helpers copied to clipboard
Unable to join with an empty string separator
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.
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