Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (type === 'json') {
return JSON.parse(value);
} else if (type === 're') {
return new RegExp(value);
} else if (type === 'date') {
return Date.now();
} else if (type === 'msg' && msg) {
return getMessageProperty(msg, value);
} else if (type === 'flow' && node) {
return node.context().flow.get(value);
} else if (type === 'global' && node) {
return node.context().global.get(value);
} else if (type === 'bool') {
return /^true$/i.test(value);
} else if (type === 'jsonata') {
return jsonata(value).evaluate({ msg: msg });
}
return value;
}
};
validate: function (v) {
try {
jsonata(v);
return true;
} catch (e) {
return false;
}
},
expand: function () {