UNPKG

@restorecommerce/handlebars-helperized

Version:

Opinionated handlebars based templating engine for rendering e-mail like content

12 lines (11 loc) 361 B
"use strict"; let customHandlebarsExtensions = (hbs, opts) => { // increment a given numerical string by one hbs.registerHelper('increment', (value, hash) => { const toIncrement = parseInt(value, 10); if (isNaN(toIncrement)) return '0'; return toIncrement + 1; }); }; module.exports = customHandlebarsExtensions;