handlebars-helpers icon indicating copy to clipboard operation
handlebars-helpers copied to clipboard

Subtract helper throws errors

Open skysteve opened this issue 6 years ago • 0 comments

As I understand it, by convention in handlebars, if a value doesn't exist the helper/value just just return an empty string. However in the case of the subtract helper if the value doesn't exist, it throws an error.

e.g.

Data

{
    "value": 10
}

template

{{#if thing}}
    {{subtract 20.00 thing}}
{{/if}}

throws an error because thing is undefined. It should return ""

skysteve avatar Jul 11 '18 13:07 skysteve