@node-red/util 2.1.4 → 2.1.5

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.
package/lib/events.js CHANGED
@@ -32,8 +32,14 @@ function wrapEventFunction(obj,func) {
32
32
  return function(eventName, listener) {
33
33
  if (deprecatedEvents.hasOwnProperty(eventName)) {
34
34
  const log = require("@node-red/util").log;
35
- const stack = (new Error().stack).split("\n")[2].split("(")[1].slice(0,-1);
36
- log.warn(`[RED.events] Deprecated use of "${eventName}" event from "${stack}". Use "${deprecatedEvents[eventName]}" instead.`)
35
+
36
+ const stack = (new Error().stack).split("\n");
37
+ let location = "(unknown)"
38
+ // See https://github.com/node-red/node-red/issues/3292
39
+ if (stack.length > 2) {
40
+ location = stack[2].split("(")[1].slice(0,-1);
41
+ }
42
+ log.warn(`[RED.events] Deprecated use of "${eventName}" event from "${location}". Use "${deprecatedEvents[eventName]}" instead.`)
37
43
  }
38
44
  return events["_"+func].call(events,eventName,listener)
39
45
  }
package/lib/util.js CHANGED
@@ -686,7 +686,7 @@ function prepareJSONataExpression(value,node) {
686
686
  return moment(arg1, arg2, arg3, arg4);
687
687
  });
688
688
  expr.registerFunction('clone', cloneMessage, '<(oa)-:o>');
689
- expr._legacyMode = /(^|[^a-zA-Z0-9_'"])msg([^a-zA-Z0-9_'"]|$)/.test(value);
689
+ expr._legacyMode = /(^|[^a-zA-Z0-9_'".])msg([^a-zA-Z0-9_'"]|$)/.test(value);
690
690
  expr._node = node;
691
691
  return expr;
692
692
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node-red/util",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "fs-extra": "10.0.0",
19
- "i18next": "21.5.4",
19
+ "i18next": "21.6.6",
20
20
  "json-stringify-safe": "5.0.1",
21
21
  "jsonata": "1.8.5",
22
22
  "lodash.clonedeep": "^4.5.0",