lib/compare.js
function compare (left, operator, right, options) {
  var result;
  
  if (arguments.length < 3) {
    throw new Error('The "compare" helper needs two arguments.');
  }

  if (options === undefined) {
    options = right;
    right = operator;
    operator = '===';
  }

  if (operators[operator] === undefined) {
    throw new Error('The "compare" helper needs a valid operator.')
  }

  result = operators[operator](left, right);
  
  if (R.isNil(options.fn)) {
    return result;
  }

  return result ? options.fn(this) : options.inverse(this);
}
function compare (left, operator, right, options) {
  var result;
  
  if (arguments.length < 3) {
    throw new Error('The "compare" helper needs two arguments.');
  }

  if (options === undefined) {
    options = right;
    right = operator;
    operator = '===';
  }

  if (operators[operator] === undefined) {
    throw new Error('The "compare" helper needs a valid operator.')
  }

  result = operators[operator](left, right);
  
  if (R.isNil(options.fn)) {
    return result;
  }

  return result ? options.fn(this) : options.inverse(this);
}
function compare ( left , operator , right , options ) { var result ; if ( arguments . length < 3 ) { throw new Error ( 'The "compare" helper needs two arguments.' ) ; } if ( options === undefined ) { options = right ; right = operator ; operator = '===' ; } if ( operators [ operator ] === undefined ) { throw new Error ( 'The "compare" helper needs a valid operator.' ) } result = operators [ operator ] ( left , right ) ; if ( R . isNil ( options . fn ) ) { return result ; } return result ? options . fn ( this ) : options . inverse ( this ) ; }
Compare two values using logical operators.

@credit: github.com/assemble
@param {*} left
@param {String} operator
@param {*} right
@param {Object} options
@return {(String|Boolean)} formatted html if block, true/false if inline
@example:
{{#compare 1 "<" 2}}
This is true.
{{else}}
This is false.
{{/compare}}

{{#if (compare 1 "<" 2)}}
Also works inline!
{{/if}}
Compare two values using logical operators .