Upgrade to JSONata 2.x

This commit is contained in:
Nick O'Leary
2024-03-04 16:32:31 +00:00
parent 6802539ccc
commit a6cbceed28
4 changed files with 96 additions and 32 deletions

View File

@@ -769,12 +769,15 @@ function evaluateJSONataExpression(expr,msg,callback) {
});
}
} else {
log.warn('Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback. '+
'This will not be optional in Node-RED 4.0. Please identify the node from the following stack '+
'and check for an update on npm. If none is available, please notify the node author.')
log.warn(new Error().stack)
const error = new Error('Calls to RED.util.evaluateJSONataExpression must include a callback.')
throw error
}
return expr.evaluate(context, bindings, callback);
expr.evaluate(context, bindings).then(result => {
callback(null, result)
}).catch(err => {
callback(err)
})
}
/**