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 2.1.2 to 2.1.3

14

lib/proxyquire.js

@@ -157,14 +157,10 @@ 'use strict'

// best we can. We also need to check if the relative module has @noCallThru.
var resolvedPath = path.resolve(path.dirname(baseModule), pathToResolve)
var moduleNoCallThru
var resolvedPath
if (hasOwnProperty.call(stubs, pathToResolve)) {
if (hasOwnProperty.call(stubs, pathToResolve) && stubs[pathToResolve]) {
// pathToResolve is currently relative on stubs from _withoutCache() call
moduleNoCallThru = hasOwnProperty.call(stubs[pathToResolve], '@noCallThru') ? stubs[pathToResolve]['@noCallThru'] : undefined
resolvedPath = path.resolve(path.dirname(baseModule), pathToResolve)
} else {
resolvedPath = path.resolve(path.dirname(baseModule), pathToResolve)
if (hasOwnProperty.call(stubs, resolvedPath)) {
// after _withoutCache() alters stubs paths to be absolute
moduleNoCallThru = hasOwnProperty.call(stubs[resolvedPath], '@noCallThru') ? stubs[resolvedPath]['@noCallThru'] : undefined
}
} else if (hasOwnProperty.call(stubs, resolvedPath) && stubs[resolvedPath]) {
// after _withoutCache() alters stubs paths to be absolute
moduleNoCallThru = hasOwnProperty.call(stubs[resolvedPath], '@noCallThru') ? stubs[resolvedPath]['@noCallThru'] : undefined
}

@@ -171,0 +167,0 @@ if (!this._preserveCache || this._noCallThru || moduleNoCallThru) {

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

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

@@ -13,2 +13,4 @@ 'use strict'

proxyquire(fooPath, { path: null })
}, function (error) {
return error.code === 'MODULE_NOT_FOUND'
})

@@ -15,0 +17,0 @@ })

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