UNPKG

sao

Version:

Futuristic scaffolding tool ⚔

11 lines (10 loc) 290 B
module.exports = function(exp, data) { /* eslint-disable no-new-func */ const fn = new Function('data', `with (data) { return ${exp} }`) try { return fn(data) } catch (err) { console.error(err.stack) console.error(`Error when evaluating filter condition: ${exp}`) } }