Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vm2

Package Overview
Dependencies
Maintainers
3
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vm2 - npm Package Compare versions

Comparing version 3.9.13 to 3.9.14

10

CHANGELOG.md

@@ -1,3 +0,7 @@

v3.9.3 (2022-12-08)
v3.9.14 (2023-02-05)
--------------------
[new] Support conditional export resolution with custom resolver. (nick-klaviyo)
v3.9.13 (2022-12-08)
--------------------
[fix] Fix typescript errors in index.d.ts

@@ -8,3 +12,3 @@

[new] Add file system API.
[fix] Fix parsing error with object patter in catch clause.
[fix] Fix parsing error with object pattern in catch clause.

@@ -183,3 +187,3 @@ v3.9.11 (2022-08-28)

-------------------
[new] Allow a custom compiler to recieve the filetype (Orta Therox)
[new] Allow a custom compiler to receive the filetype (Orta Therox)
[new] Allow in-sandbox requires to also get called through the compiler (Orta Therox)

@@ -186,0 +190,0 @@ [new] Support whitelisting modules inside a VM (Orta Therox)

@@ -85,3 +85,3 @@ import { EventEmitter } from 'events';

/* An additional lookup function in case a module wasn't found in one of the traditional node lookup paths. */
resolve?: (moduleName: string, parentDirname: string) => string | undefined;
resolve?: (moduleName: string, parentDirname: string) => string | { path: string, module?: string } | undefined;
/** Custom require to require host and built-in modules. */

@@ -88,0 +88,0 @@ customRequire?: (id: string) => any;

@@ -325,4 +325,9 @@ 'use strict';

if (!resolved) return undefined;
if (externals) externals.push(new RegExp('^' + escapeRegExp(resolved)));
return resolver.loadAsFileOrDirecotry(resolved, extList);
if (typeof resolved === 'string') {
if (externals) externals.push(new RegExp('^' + escapeRegExp(resolved)));
return resolver.loadAsFileOrDirectory(resolved, extList);
}
const {module=x, path: resolvedPath} = resolved;
if (externals) externals.push(new RegExp('^' + escapeRegExp(resolvedPath)));
return resolver.loadNodeModules(module, [resolvedPath], extList);
};

@@ -329,0 +334,0 @@ }

@@ -245,3 +245,3 @@ 'use strict';

// a. set Y to be the filesystem root
f = this.loadAsFileOrDirecotry(x, extList);
f = this.loadAsFileOrDirectory(x, extList);
if (f) return f;

@@ -260,3 +260,3 @@

// b. LOAD_AS_DIRECTORY(Y + X)
f = this.loadAsFileOrDirecotry(this.pathConcat(paths[i], x), extList);
f = this.loadAsFileOrDirectory(this.pathConcat(paths[i], x), extList);
if (f) return f;

@@ -267,3 +267,3 @@ }

// b. LOAD_AS_DIRECTORY(Y + X)
f = this.loadAsFileOrDirecotry(this.pathConcat(path, x), extList);
f = this.loadAsFileOrDirectory(this.pathConcat(path, x), extList);
if (f) return f;

@@ -276,3 +276,3 @@ } else {

// b. LOAD_AS_DIRECTORY(Y + X)
f = this.loadAsFileOrDirecotry(this.pathConcat(path, x), extList);
f = this.loadAsFileOrDirectory(this.pathConcat(path, x), extList);
if (f) return f;

@@ -322,3 +322,3 @@ }

loadAsFileOrDirecotry(x, extList) {
loadAsFileOrDirectory(x, extList) {
// a. LOAD_AS_FILE(X)

@@ -563,3 +563,3 @@ const f = this.loadAsFile(x, extList);

// b. LOAD_AS_DIRECTORY(RESOLVED_PATH)
f = this.loadAsFileOrDirecotry(resolvedPath, extList);
f = this.loadAsFileOrDirectory(resolvedPath, extList);
}

@@ -566,0 +566,0 @@ if (f) return f;

@@ -16,3 +16,3 @@ {

],
"version": "3.9.13",
"version": "3.9.14",
"main": "index.js",

@@ -19,0 +19,0 @@ "sideEffects": false,

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc