cimpress-handlebars-helpers
v0.0.5
Published
A set of simple handlebars helpers
Downloads
2
Maintainers
Readme
A set of simple handlebars helpers
Included helpers
Usage
flatMap
import {flatMapHelper} from 'cimpress-handlebars-helpers';
handlebars.registerHelper("flatMap", flatMapHelper);
Params
array
- an array to iterate overpath
- a path that identifies the element to take
Example
{{flatMap array "itemId"}}
filterByValues
import {filterByValuesHelper} from 'cimpress-handlebars-helpers';
handlebars.registerHelper("filterByValues", filterByValuesHelper);
Params
collection
- an array to iterate overelement
- element to use for filteringvalues
- filter the array based on these values
Example
{{filterByValues items 'itemId' [ '1', '2', '3' ] }}