Socket
Socket
Sign inDemoInstall

mm

Package Overview
Dependencies
9
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.4 to 1.3.5

5

History.md
1.3.5 / 2015-09-29
==================
* fix: should support mock multi env
1.3.4 / 2015-09-24

@@ -3,0 +8,0 @@ ==================

2

lib/es6.js
/**!
* mm - lib/es6.js
*
* Copyright(c) fengmk2 and other contributors.

@@ -5,0 +3,0 @@ * MIT Licensed

/**!
* mm - lib/mm.js
*
* Copyright(c) node-modules and other contributors.

@@ -27,5 +25,5 @@ * MIT Licensed

var mockEnvs = [
// [key, originValue], ...
];
var mockEnvs = {
// key1: [val1, val2, ...]
};

@@ -37,3 +35,6 @@ var mock = module.exports = function mock(obj, key, method) {

method = method || '';
mockEnvs.push([ key, process.env[key] ]);
if (!mockEnvs[key]) {
mockEnvs[key] = [];
}
mockEnvs[key].push(process.env[key]);
}

@@ -459,12 +460,13 @@ return muk.apply(null, arguments);

if (mockEnvs.length > 0) {
var item = mockEnvs[0];
if (item[1] === undefined || item[1] === null) {
process.env[item[0]] = '';
for (var key in mockEnvs) {
var values = mockEnvs[key];
var firstValue = values[0];
if (firstValue === undefined || firstValue === null) {
process.env[key] = '';
} else {
process.env[item[0]] = item[1];
process.env[key] = firstValue;
}
mockEnvs = [];
}
mockEnvs = {};
return this;
};
{
"name": "mm",
"version": "1.3.4",
"version": "1.3.5",
"description": "mock mate, mock http request, fs access and so on.",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc