Comparing version 2.0.0 to 2.1.0
@@ -13,3 +13,3 @@ 'use strict'; | ||
...contextify.OPTIONS, | ||
preventEscape: mode ? 'afterEvaluate' : '', | ||
microtaskMode: mode ? 'afterEvaluate' : undefined, | ||
}); | ||
@@ -16,0 +16,0 @@ }; |
@@ -23,3 +23,3 @@ 'use strict'; | ||
const READ_OPTS = { withFileTypes: true }; | ||
const futher = (max, depth) => max === true || (typeof max === 'number' && depth + 1 <= max); | ||
const further = (max, depth) => max === true || (typeof max === 'number' && depth + 1 <= max); | ||
function dir(src, options = {}) { | ||
@@ -36,3 +36,3 @@ const { depth: max = true, flat = false, access } = options; | ||
var isDir = f.isDirectory(), name = f.name, path = join(src, name); | ||
if ((isDir && !futher(max, depth)) || !isAllow(path)) return; | ||
if ((isDir && !further(max, depth)) || !isAllow(path)) return; | ||
if (isDir && flat) return void await pull(path, depth + 1); | ||
@@ -39,0 +39,0 @@ var ext = extname(name), key = base(name, ext.match(JS_EXT) ? ext : ''); |
{ | ||
"license": "MIT", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"type": "commonjs", | ||
@@ -50,11 +50,11 @@ "name": "isolation", | ||
"devDependencies": { | ||
"@types/node": "^20.10.4", | ||
"eslint": "^8.55.0", | ||
"eslint-config-astrohelm": "^1.2.0", | ||
"@types/node": "^20.11.28", | ||
"eslint": "^8.57.0", | ||
"eslint-config-astrohelm": "^1.3.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-import": "^2.29.0", | ||
"eslint-plugin-prettier": "^5.0.1", | ||
"prettier": "^3.1.1", | ||
"typescript": "^5.3.3" | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"prettier": "^3.2.5", | ||
"typescript": "^5.4.2" | ||
} | ||
} |
@@ -13,3 +13,3 @@ <h1 align="center"> | ||
> | ||
> ## **Possible usecase** | ||
> ## **Possible use case** | ||
> | ||
@@ -153,3 +153,3 @@ > May be useful as routing loader, if some loaded route makes an error while runtime, you may | ||
> | ||
> Remember to reuse your contexts. This will encrease performance of your application. To help you | ||
> Remember to reuse your contexts. This will increase performance of your application. To help you | ||
> with this we have default contexts: | ||
@@ -285,15 +285,15 @@ | ||
| Option | Possible | Default | Description | | ||
| ---------------- | ---------------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------- | | ||
| **type** | iso \| cjs | cjs | Type of script handling, see [syntax types](#module-types) | | ||
| **ctx** | object | - | Realm context, see [Context API](#context-api) | | ||
| **filename** | string | ISO | Name of the module , also it is global variable **\_\_filename** for root realm | | ||
| **dir** | string | process.cwd() | Module directory , also it is global varibale **\_\_dirname** and realm require startpoint | | ||
| **npmIsolation** | boolean | false | Controls npm modules isolation | | ||
| **access** | [Access](./types/options.d.ts#L51) | - | Isolation restrictions, see [Access API](#reader-api) | | ||
| **prepare** | boolean | false | Reader would'nt execute script for you | | ||
| **flat** | boolean | false | Reader will flat nested scripts | | ||
| **depth** | boolean \| number | true | Restricts dir reading depth | | ||
| **script** | [ScriptOptions](./types/options.d.ts#L63) | - | Configuration for VM.Script initialization | | ||
| **run** | [RunningCodeOptions](./types/options.d.ts#L62) | { timeout: 1000 } | Configuration for VM.Script execution | | ||
| Option | Possible | Default | Description | | ||
| ---------------- | ---------------------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------- | | ||
| **type** | iso \| cjs | cjs | Type of script handling, see [syntax types](#module-types) | | ||
| **ctx** | object | - | Realm context, see [Context API](#context-api) | | ||
| **filename** | string | ISO | Name of the module , also it is global variable **\_\_filename** for root realm | | ||
| **dir** | string | process.cwd() | Module directory , also it is global variable **\_\_dirname** and realm require start point | | ||
| **npmIsolation** | boolean | false | Controls npm modules isolation | | ||
| **access** | [Access](./types/options.d.ts#L51) | - | Isolation restrictions, see [Access API](#reader-api) | | ||
| **prepare** | boolean | false | Reader would'nt execute script for you | | ||
| **flat** | boolean | false | Reader will flat nested scripts | | ||
| **depth** | boolean \| number | true | Restricts dir reading depth | | ||
| **script** | [ScriptOptions](./types/options.d.ts#L63) | - | Configuration for VM.Script initialization | | ||
| **run** | [RunningCodeOptions](./types/options.d.ts#L62) | { timeout: 1000 } | Configuration for VM.Script execution | | ||
@@ -300,0 +300,0 @@ <h2 align="center">Copyright & contributors</h2> |
@@ -63,3 +63,3 @@ import type { Context, Script as TScript, ScriptOptions, BaseOptions } from 'node:vm'; | ||
* @example <caption>Skip init process</caption> | ||
* console.log(Isolation.execute(`module.exporst = (a, b) => a + b;`)(2 + 2)); // Output: 4 | ||
* console.log(Isolation.execute(`module.exports = (a, b) => a + b;`)(2 + 2)); // Output: 4 | ||
* Isolation.execute(`async (a, b) => a + b;`, { type: 'iso' })(2 + 2).then(console.log); // Output: 4 | ||
@@ -66,0 +66,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29556