Socket
Socket
Sign inDemoInstall

mm

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mm - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

5

History.md
1.5.0 / 2016-06-13
==================
* feat: export isMocked (#27)
1.4.0 / 2016-06-12

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

29

lib/mm.js

@@ -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",

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