cloudfour / core-hbs-helpers

Handlebars helpers that we usually need
MIT License
11 stars 2 forks source link

all and any helpers #71

Closed tylersticka closed 5 years ago

tylersticka commented 5 years ago

In a recent project, I needed to be able to test whether any of three properties were truthy. Currently, our or helpers only allow for two. And it can only be used as a block helper, so I couldn't do something like {{#or firstProp (or secondProp thirdProp)}}.

This adds all and any helpers as successors to and and or. They also support being used as block or inline helpers, so they can be combined in a single call or passed along as a property.

It also updates a function in svg that seems to have been broken by a previous Ramda version bump.


Closes #53

tylersticka commented 5 years ago

@gerardo-rodriguez @calebeby These now use every and some, and I also removed the dependency on Ramda as it wasn't doing much by that point. Still keeping to ES5 for consistency, though I think eventually we should consider revising these to use newer conventions. (See #30)