Comparing version 3.9.12 to 3.9.13
@@ -0,1 +1,5 @@ | ||
v3.9.3 (2022-12-08) | ||
-------------------- | ||
[fix] Fix typescript errors in index.d.ts | ||
v3.9.12 (2022-11-29) | ||
@@ -2,0 +6,0 @@ -------------------- |
@@ -1,2 +0,2 @@ | ||
import {EventEmitter} from 'events'; | ||
import { EventEmitter } from 'events'; | ||
import fs from 'fs'; | ||
@@ -10,5 +10,5 @@ import pa from 'path'; | ||
/** Implements fs.statSync */ | ||
statSync: typeof fs.statSync; | ||
statSync: typeof fs.statSync; | ||
/** Implements fs.readFileSync */ | ||
readFileSync: typeof fs.readFileSync; | ||
readFileSync: typeof fs.readFileSync; | ||
} | ||
@@ -23,13 +23,9 @@ | ||
/** Implements path.isAbsolute */ | ||
isAbsolute: typeof pa.isAbsolute; | ||
isAbsolute: typeof pa.isAbsolute; | ||
/** Implements path.join */ | ||
join: typeof pa.join; | ||
join: typeof pa.join; | ||
/** Implements path.basename */ | ||
basename: typeof pa.basename; | ||
basename: typeof pa.basename; | ||
/** Implements path.dirname */ | ||
dirname: typeof pa.dirname; | ||
/** Implements fs.statSync */ | ||
statSync: typeof fs.statSync; | ||
/** Implements fs.readFileSync */ | ||
readFileSync: typeof fs.readFileSync; | ||
dirname: typeof pa.dirname; | ||
} | ||
@@ -40,5 +36,5 @@ | ||
*/ | ||
export interface VMFileSystemInterface implements VMFS, VMPath { | ||
export interface VMFileSystemInterface extends VMFS, VMPath { | ||
/** Implements (sep) => sep === path.sep */ | ||
isSeparator(char: string): boolean; | ||
isSeparator(char: string): boolean; | ||
} | ||
@@ -50,3 +46,19 @@ | ||
export class VMFileSystem implements VMFileSystemInterface { | ||
constructor(options?: {fs?: VMFS, path?: VMPath}); | ||
constructor(options?: { fs?: VMFS, path?: VMPath }); | ||
/** Implements fs.statSync */ | ||
statSync: typeof fs.statSync; | ||
/** Implements fs.readFileSync */ | ||
readFileSync: typeof fs.readFileSync; | ||
/** Implements path.resolve */ | ||
resolve: typeof pa.resolve; | ||
/** Implements path.isAbsolute */ | ||
isAbsolute: typeof pa.isAbsolute; | ||
/** Implements path.join */ | ||
join: typeof pa.join; | ||
/** Implements path.basename */ | ||
basename: typeof pa.basename; | ||
/** Implements path.dirname */ | ||
dirname: typeof pa.dirname; | ||
/** Implements (sep) => sep === path.sep */ | ||
isSeparator(char: string): boolean; | ||
} | ||
@@ -58,4 +70,6 @@ | ||
export interface VMRequire { | ||
/** Array of allowed built-in modules, accepts ["*"] for all. Using "*" increases the attack surface and potential | ||
* new modules allow to escape the sandbox. (default: none) */ | ||
/** | ||
* Array of allowed built-in modules, accepts ["*"] for all. Using "*" increases the attack surface and potential | ||
* new modules allow to escape the sandbox. (default: none) | ||
*/ | ||
builtin?: string[]; | ||
@@ -89,3 +103,3 @@ /* | ||
*/ | ||
type CompilerFunction = (code: string, filename: string) => string; | ||
export type CompilerFunction = (code: string, filename: string) => string; | ||
@@ -137,4 +151,6 @@ /** | ||
require?: boolean | VMRequire; | ||
/** **WARNING**: This should be disabled. It allows to create a NodeVM form within the sandbox which could return any host module. | ||
* `true` to enable VMs nesting (default: `false`). */ | ||
/** | ||
* **WARNING**: This should be disabled. It allows to create a NodeVM form within the sandbox which could return any host module. | ||
* `true` to enable VMs nesting (default: `false`). | ||
*/ | ||
nesting?: boolean; | ||
@@ -145,10 +161,10 @@ /** `commonjs` (default) to wrap script into CommonJS wrapper, `none` to retrieve value returned by the script. */ | ||
sourceExtensions?: string[]; | ||
/** | ||
* Array of arguments passed to `process.argv`. | ||
* This object will not be copied and the script can change this object. | ||
/** | ||
* Array of arguments passed to `process.argv`. | ||
* This object will not be copied and the script can change this object. | ||
*/ | ||
argv?: string[]; | ||
/** | ||
* Environment map passed to `process.env`. | ||
* This object will not be copied and the script can change this object. | ||
/** | ||
* Environment map passed to `process.env`. | ||
* This object will not be copied and the script can change this object. | ||
*/ | ||
@@ -172,3 +188,3 @@ env?: any; | ||
/** Runs the code */ | ||
run(script: string|VMScript, options?: string|{filename?: string}): any; | ||
run(script: string | VMScript, options?: string | { filename?: string }): any; | ||
/** Runs the code in the specific file */ | ||
@@ -199,3 +215,3 @@ runFile(filename: string): any; | ||
/** | ||
/** | ||
* Create NodeVM and run code inside it. | ||
@@ -217,3 +233,3 @@ * | ||
/** Direct access to the global sandbox object */ | ||
/** Direct access to the global sandbox object */ | ||
readonly sandbox: any; | ||
@@ -223,3 +239,3 @@ /** Only here because of implements VM. Does nothing. */ | ||
/** Runs the code */ | ||
run(js: string|VMScript, options?: string|{filename?: string, wrapper?: "commonjs" | "none", strict?: boolean}): any; | ||
run(js: string | VMScript, options?: string | { filename?: string, wrapper?: "commonjs" | "none", strict?: boolean }): any; | ||
/** Runs the code in the specific file */ | ||
@@ -263,4 +279,4 @@ runFile(filename: string): any; | ||
readonly compiler: "javascript" | "coffeescript" | CompilerFunction; | ||
/** | ||
* Wraps the code | ||
/** | ||
* Wraps the code | ||
* @deprecated | ||
@@ -274,2 +290,2 @@ */ | ||
/** Custom Error class */ | ||
export class VMError extends Error {} | ||
export class VMError extends Error { } |
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "3.9.12", | ||
"version": "3.9.13", | ||
"main": "index.js", | ||
@@ -19,0 +19,0 @@ "sideEffects": false, |
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
211837
5581