Socket
Socket
Sign inDemoInstall

rewire

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rewire - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

4

CHANGELOG.md
Changelog
---------
### 2.1.3
- Fix shadowing of internal `module`, `exports` and `require` when a global counterpart exists [jhnns/rewire-webpack#6](https://github.com/jhnns/rewire-webpack/pull/6)
### 2.1.2
- Fixed missing `var` statement which lead to pollution of global namespace [#33](https://github.com/jhnns/rewire/pull/33)

@@ -7,0 +9,0 @@

@@ -29,3 +29,8 @@ /**

value = globalObj[key];
src += "var " + key + " = global." + key + "; ";
// key may be an invalid variable name (e.g. 'a-b')
try {
eval("var " + key + ";");
src += "var " + key + " = global." + key + "; ";
} catch(e) {}
}

@@ -36,2 +41,2 @@

module.exports = getImportGlobalsSrc;
module.exports = getImportGlobalsSrc;
{
"name" : "rewire",
"version" : "2.1.3",
"description" : "Easy dependency injection for node.js unit testing",
"keywords" : [
"dependency",
"injection",
"mock",
"shim",
"module",
"unit",
"test",
"leak",
"inspect"
],
"author" : {
"name" : "Johannes Ewald",
"email" : "mail@johannesewald.de"
},
"main" : "lib/index.js",
"homepage": "https://github.com/jhnns/rewire",
"bugs" : {
"url" : "https://github.com/jhnns/rewire/issues",
"email" : "mail@johannesewald.de"
},
"repository": {
"type": "git",
"url": "git://github.com/jhnns/rewire.git"
},
"devDependencies": {
"mocha": "1.x",
"expect.js": "0.x",
"coffee-script": "1.x"
},
"scripts" : {
"test" : "node node_modules/mocha/bin/mocha -R spec",
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha"
}
}
"name": "rewire",
"version": "2.1.4",
"description": "Easy dependency injection for node.js unit testing",
"keywords": [
"dependency",
"injection",
"mock",
"shim",
"module",
"unit",
"test",
"leak",
"inspect"
],
"author": {
"name": "Johannes Ewald",
"email": "mail@johannesewald.de"
},
"main": "lib/index.js",
"homepage": "https://github.com/jhnns/rewire",
"bugs": {
"url": "https://github.com/jhnns/rewire/issues",
"email": "mail@johannesewald.de"
},
"repository": {
"type": "git",
"url": "git://github.com/jhnns/rewire.git"
},
"devDependencies": {
"coffee-script": "^1.8.0",
"expect.js": "^0.3.1",
"mocha": "^2.1.0"
},
"scripts": {
"test": "node node_modules/mocha/bin/mocha -R spec",
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha"
}
}

@@ -154,2 +154,11 @@ rewire

**Globals with invalid variable names**<br>
rewire imports global variables into the local scope by prepending a list of `var` declarations:
```javascript
var someGlobalVar = global.someGlobalVar;
```
If `someGlobalVar` is not a valid variable name, rewire just ignores it. **In this case you're not able to override the global variable locally**.
<br />

@@ -156,0 +165,0 @@

Sorry, the diff of this file is not supported yet

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