proxyquire
Advanced tools
Comparing version 0.3.2 to 0.3.3
{ | ||
"name": "proxyquire", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Proxies nodejs require in order to allow overriding dependencies during testing.", | ||
@@ -5,0 +5,0 @@ "main": "proxyquire.js", |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
/*jshint laxbreak:true*/ | ||
@@ -25,2 +26,6 @@ | ||
function escapeBackslashes(value) { | ||
return value.replace(/\\/g, '\\\\'); | ||
} | ||
function getTmpDir () { | ||
@@ -179,4 +184,2 @@ var defaultTmp = '/tmp' | ||
/** | ||
@@ -205,8 +208,8 @@ * Resolves specified module and overrides dependencies with specified stubs. | ||
, mdlProxyCode = | ||
[ 'var __dirname = "' + path.dirname(resolvedFile) + '"; ' | ||
, 'var __filename = "' + resolvedFile + '"; ' | ||
[ 'var __dirname = "' + escapeBackslashes(path.dirname(resolvedFile)) + '"; ' | ||
, 'var __filename = "' + escapeBackslashes(resolvedFile) + '"; ' | ||
, 'function require(mdl) { ' | ||
, 'return module' | ||
, '.require("' , __filename, '")' | ||
, '._require(mdl, "' + resolvedProxy + '", __dirname); ' | ||
, '.require("' , escapeBackslashes(__filename), '")' | ||
, '._require(mdl, "' + escapeBackslashes(resolvedProxy) + '", __dirname); ' | ||
, '} ' | ||
@@ -213,0 +216,0 @@ , originalCode |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
38212
27
883
0
1