Skip to content

Commit 1484b85

Browse files
jamiepenneyAlkarex
andauthoredFeb 8, 2023
jsonata expression evaluation is async, so needs to be awaited (#11)
* jsonata expression evaluation is async, so needs to be awaited https://github.com/jsonata-js/jsonata/blob/master/CHANGELOG.md#200-major-release * Another await --------- Co-authored-by: Alexandre Alapetite <alexandre.alapetite@alexandra.dk>
1 parent e781678 commit 1484b85

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎json-multi-schema-resolver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = RED => {
2828
for (const mapping of mappings) {
2929
if (mapping.query && mapping.cases) {
3030
const expression = jsonata(mapping.query);
31-
let match = expression.evaluate(payload);
31+
let match = await expression.evaluate(payload);
3232
if (match) {
3333
if (match === true) {
3434
// Special case for boolean

‎json-multi-schema-transformer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = RED => {
5454

5555
if (jsonataExpression) {
5656
// Perform transformation
57-
return jsonataExpression.evaluate(payload);
57+
return await jsonataExpression.evaluate(payload);
5858
}
5959

6060
return false;

0 commit comments

Comments
 (0)
Please sign in to comment.