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

proxyquire

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxyquire - npm Package Compare versions

Comparing version 1.7.9 to 1.7.10

14

lib/proxyquire.js

@@ -187,9 +187,11 @@ 'use strict';

var stubIds = Object.keys(stubs).map(function (stubPath) {
return resolve.sync(stubPath, {
basedir: dirname(id),
extensions: Object.keys(require.extensions),
paths: Module.globalPaths
})
try {
return resolve.sync(stubPath, {
basedir: dirname(id),
extensions: Object.keys(require.extensions),
paths: Module.globalPaths
})
} catch (_) {}
});
var ids = [id].concat(stubIds);
var ids = [id].concat(stubIds.filter(Boolean));

@@ -196,0 +198,0 @@ ids.forEach(function (id) {

{
"name": "proxyquire",
"version": "1.7.9",
"version": "1.7.10",
"description": "Proxies nodejs require in order to allow overriding dependencies during testing.",

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

@@ -103,3 +103,11 @@ /*jshint asi:true*/

});
it('silences errors when stub lookups fail', function() {
var proxyquire = require('..').noPreserveCache();
assert.doesNotThrow(function () {
proxyquire.load('./samples/cache/foo', { './does-not-exist': {} });
})
});
});
});
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