@edirect/form-engine
Version:
Achieve form logic reusage with forms expressed in json format.
22 lines (21 loc) • 618 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.subtract = exports.replaceAll = exports.concatenate = exports.add = void 0;
const concatenate = (a, b) => {
return a + b;
};
exports.concatenate = concatenate;
const add = (a, b) => {
return ((parseInt(a) || 0) + (parseInt(b) || 0)).toString();
};
exports.add = add;
const subtract = (a, b) => {
return parseInt(a) - parseInt(b);
};
exports.subtract = subtract;
const replaceAll = (value, searchValue, replaceValue) => {
return value.replace(new RegExp(searchValue, 'g'), replaceValue);
};
exports.replaceAll = replaceAll;