isolated-function 0.1.19 → 0.1.21
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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "isolated-function",
|
|
3
3
|
"description": "Runs untrusted code in a Node.js v8 sandbox.",
|
|
4
4
|
"homepage": "https://github.com/Kikobeats/isolated-function",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.21",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./src/index.js"
|
package/src/compile/build.js
CHANGED
|
@@ -64,7 +64,7 @@ module.exports = code => {
|
|
|
64
64
|
const dependencies = new Set()
|
|
65
65
|
|
|
66
66
|
// Parse the code into an AST
|
|
67
|
-
const ast = acorn.parse(code, { ecmaVersion:
|
|
67
|
+
const ast = acorn.parse(code, { ecmaVersion: 2023, sourceType: 'module' })
|
|
68
68
|
|
|
69
69
|
// Traverse the AST to find require and import statements
|
|
70
70
|
walk.simple(ast, {
|
|
@@ -8,9 +8,9 @@ const path = require('path')
|
|
|
8
8
|
const install = (() => {
|
|
9
9
|
try {
|
|
10
10
|
execSync('which pnpm').toString().trim()
|
|
11
|
-
return 'pnpm install'
|
|
11
|
+
return 'pnpm install --no-lockfile --silent'
|
|
12
12
|
} catch {
|
|
13
|
-
return 'npm install'
|
|
13
|
+
return 'npm install --no-package-lock --silent'
|
|
14
14
|
}
|
|
15
15
|
})()
|
|
16
16
|
|
|
@@ -4,7 +4,7 @@ const walk = require('acorn-walk')
|
|
|
4
4
|
const acorn = require('acorn')
|
|
5
5
|
|
|
6
6
|
module.exports = code => {
|
|
7
|
-
const ast = acorn.parse(code, { ecmaVersion:
|
|
7
|
+
const ast = acorn.parse(code, { ecmaVersion: 2023, sourceType: 'module' })
|
|
8
8
|
|
|
9
9
|
let newCode = ''
|
|
10
10
|
let lastIndex = 0
|