@node-red/util 3.1.0-beta.1 → 3.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/util.js +11 -3
  2. package/package.json +3 -3
package/lib/util.js CHANGED
@@ -25,7 +25,7 @@ const moment = require("moment-timezone");
25
25
  const safeJSONStringify = require("json-stringify-safe");
26
26
  const util = require("util");
27
27
  const { hasOwnProperty } = Object.prototype;
28
-
28
+ const log = require("./log")
29
29
  /**
30
30
  * Safely returns the object construtor name.
31
31
  * @return {String} the name of the object constructor if it exists, empty string otherwise.
@@ -671,8 +671,11 @@ function evaluateNodeProperty(value, type, node, msg, callback) {
671
671
  } else if (type === 'bool') {
672
672
  result = /^true$/i.test(value);
673
673
  } else if (type === 'jsonata') {
674
- var expr = prepareJSONataExpression(value,node);
675
- result = evaluateJSONataExpression(expr,msg);
674
+ var expr = prepareJSONataExpression(value, node);
675
+ result = evaluateJSONataExpression(expr, msg, callback);
676
+ if (callback) {
677
+ return
678
+ }
676
679
  } else if (type === 'env') {
677
680
  result = evaluateEnvProperty(value, node);
678
681
  }
@@ -767,6 +770,11 @@ function evaluateJSONataExpression(expr,msg,callback) {
767
770
  })
768
771
  });
769
772
  }
773
+ } else {
774
+ log.warn('Deprecated API warning: Calls to RED.util.evaluateJSONataExpression must include a callback. '+
775
+ 'This will not be optional in Node-RED 4.0. Please identify the node from the following stack '+
776
+ 'and check for an update on npm. If none is available, please notify the node author.')
777
+ log.warn(new Error().stack)
770
778
  }
771
779
  return expr.evaluate(context, bindings, callback);
772
780
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/util",
3
- "version": "3.1.0-beta.1",
3
+ "version": "3.1.0-beta.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,12 +15,12 @@
15
15
  }
16
16
  ],
17
17
  "dependencies": {
18
- "fs-extra": "10.1.0",
18
+ "fs-extra": "11.1.1",
19
19
  "i18next": "21.10.0",
20
20
  "json-stringify-safe": "5.0.1",
21
21
  "jsonata": "1.8.6",
22
22
  "lodash.clonedeep": "^4.5.0",
23
23
  "moment": "2.29.4",
24
- "moment-timezone": "0.5.39"
24
+ "moment-timezone": "0.5.43"
25
25
  }
26
26
  }