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.19",
5
+ "version": "0.1.21",
6
6
  "main": "src/index.js",
7
7
  "exports": {
8
8
  ".": "./src/index.js"
@@ -20,7 +20,9 @@ module.exports = ({ content, cwd }) =>
20
20
  sourcefile: 'index.js'
21
21
  },
22
22
  bundle: true,
23
- ...MINIFY,
24
23
  write: false,
25
- platform: 'node'
24
+ platform: 'node',
25
+ legalComments: 'eof',
26
+ target: 'es2023',
27
+ ...MINIFY
26
28
  })
@@ -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: 2020, sourceType: 'module' })
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: 2020, sourceType: 'module' })
7
+ const ast = acorn.parse(code, { ecmaVersion: 2023, sourceType: 'module' })
8
8
 
9
9
  let newCode = ''
10
10
  let lastIndex = 0