Comparing version 1.4.0 to 1.5.0
1.5.0 / 2016-06-13 | ||
================== | ||
* feat: export isMocked (#27) | ||
1.4.0 / 2016-06-12 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -23,18 +23,4 @@ /**! | ||
var nodeMajorVersion = Number(process.versions.node.split('.')[0]); | ||
var mockEnvs = { | ||
// key1: [val1, val2, ...] | ||
}; | ||
var mock = module.exports = function mock(obj, key, method) { | ||
if (nodeMajorVersion < 4 && obj === process.env) { | ||
// hotfix for https://github.com/nodejs/node/pull/2999 on node<4.0.0 | ||
// use empty string instead of undefined or null | ||
method = method || ''; | ||
if (!mockEnvs[key]) { | ||
mockEnvs[key] = []; | ||
} | ||
mockEnvs[key].push(process.env[key]); | ||
} | ||
var mock = module.exports = function mock() { | ||
return muk.apply(null, arguments); | ||
@@ -67,2 +53,4 @@ }; | ||
exports.isMocked = muk.isMocked; | ||
/** | ||
@@ -459,14 +447,3 @@ * create an error instance | ||
muk.restore(); | ||
for (var key in mockEnvs) { | ||
var values = mockEnvs[key]; | ||
var firstValue = values[0]; | ||
if (firstValue === undefined || firstValue === null) { | ||
process.env[key] = ''; | ||
} else { | ||
process.env[key] = firstValue; | ||
} | ||
} | ||
mockEnvs = {}; | ||
return this; | ||
}; |
{ | ||
"name": "mm", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "mock mate, mock http request, fs access and so on.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality 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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
0
17456
5
459
1
0