helpers.js
426 Bytes
'use strict';
import _ from 'lodash';
const helpers = {
equals: (a, b, opts) => {
if (a === b) {
return opts.fn(this);
} else {
return opts.inverse(this);
}
},
replace: (str, pattern, replacement) => {
return _.replace(str, new RegExp(pattern), replacement);
},
json: (obj) => {
return JSON.stringify(obj);
}
};
export default helpers;