@usebruno/js 0.9.4 → 0.10.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usebruno/js",
3
- "version": "0.9.4",
3
+ "version": "0.10.0",
4
4
  "license": "MIT",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -8,7 +8,7 @@
8
8
  "package.json"
9
9
  ],
10
10
  "peerDependencies": {
11
- "vm2": "^3.9.13"
11
+ "@n8n/vm2": "^3.9.23"
12
12
  },
13
13
  "scripts": {
14
14
  "test": "jest --testPathIgnorePatterns test.js"
@@ -1,4 +1,4 @@
1
- const { NodeVM } = require('vm2');
1
+ const { NodeVM } = require('@n8n/vm2');
2
2
  const path = require('path');
3
3
  const http = require('http');
4
4
  const https = require('https');
@@ -1,4 +1,4 @@
1
- const { NodeVM } = require('vm2');
1
+ const { NodeVM } = require('@n8n/vm2');
2
2
  const chai = require('chai');
3
3
  const path = require('path');
4
4
  const http = require('http');
package/src/utils.js CHANGED
@@ -92,7 +92,12 @@ const evaluateJsTemplateLiteral = (templateLiteral, context) => {
92
92
  }
93
93
 
94
94
  if (!isNaN(templateLiteral)) {
95
- return Number(templateLiteral);
95
+ const number = Number(templateLiteral);
96
+ // Check if the number is too high. Too high number might get altered, see #1000
97
+ if (number > Number.MAX_SAFE_INTEGER) {
98
+ return templateLiteral;
99
+ }
100
+ return number;
96
101
  }
97
102
 
98
103
  templateLiteral = '`' + templateLiteral + '`';