Closed erikjung closed 9 years ago
Heh, now that I'm reading this, I guess &&
and ||
really aren't comparisons.
Assemble just keeps those as their own little helpers. Maybe they are unique, and I conflated them with ifEqual
because of the similarity in naming convention.
@tylersticka I'd be fine with either of these scenarios:
ifAnd
and ifOr
(perhaps naming them differently...I feel that anything with "if" should also have an "unless" counterpart)logic
for now) that acts like compare
but supports the &&
and ||
operators.I like the first idea better but by a small margin. I'd be find with ifAnd
and ifOr
or even just and
and or
. (That's a confusing sentence.)
@tylersticka Changes made, and PR description updated.
Yay! :clap:
Closes #3
Summary
ifAnd
andifOr
helpers have been replaced with leaner, renamedand
andor
helpers.ifElse
helper has been removed.compare
helper has been added.This new
compare
helper is modeled after the (identically named) helper found at https://github.com/assemble/handlebars-helpers/blob/master/lib/helpers/helpers-comparisons.js, and differs by using functions from the Ramda.js library. Why? In addition to reducing a bit of code on our end, I think there are (and will be) other opportunities to leverage the functional nature of Ramda (opposed to something like Underscore) in other helper functions.CC @saralohr @nicolemors