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

@nightwatch/esbuild-utils

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nightwatch/esbuild-utils - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

2

package.json

@@ -6,3 +6,3 @@ {

},
"version": "0.1.7",
"version": "0.1.8",
"description": "",

@@ -9,0 +9,0 @@ "main": "index.js",

const path = require('path');
const process = require('process');
const {Script} = require('vm');
const {builtinModules} = require('node:module');

@@ -12,2 +14,26 @@ const getDefaultExport = function (exported) {

function createRequireShim(relativeModulePath) {
function resolveShim(requirePath) {
if (path.isAbsolute(requirePath) || builtinModules.includes(requirePath)) {
return requirePath;
}
let relativePoint = path.join(process.cwd(), 'node_modules');
if (requirePath.startsWith('.')) {
relativePoint = path.dirname(relativeModulePath);
}
return path.join(relativePoint, requirePath);
}
function requireShim(requirePath) {
return require(resolveShim(requirePath));
};
requireShim.resolve = resolveShim;
return requireShim;
}
/**

@@ -43,11 +69,11 @@ * Creates a VM instance for running in-memory code in the current global

new Script(content, {filename: virtualModulePath}).runInThisContext()(contextModule, function (requirePath) {
const relativePoint = requirePath.startsWith('.') ? path.dirname(realModulePath) : path.join(process.cwd(), 'node_modules');
const absolutePathToModule = path.isAbsolute(requirePath) ? requirePath : path.join(relativePoint, requirePath);
new Script(content, {filename: virtualModulePath}).runInThisContext()(
contextModule,
createRequireShim(realModulePath),
realModulePath,
path.dirname(realModulePath)
);
return require(absolutePathToModule);
}, realModulePath, path.dirname(realModulePath));
return getDefaultExport(contextModule.exports);
};
};
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