jsdom-global
Advanced tools
Comparing version 1.5.0 to 1.6.1
@@ -0,1 +1,9 @@ | ||
## [v1.6.1] | ||
> Jan 15, 2016 | ||
- Make `jsdomGlobal()` idempotent - that is, you may call it twice and expect | ||
the same result without any side effects. | ||
[v1.6.1]: https://github.com/rstacruz/jsdom-global/compare/v1.5.0...v1.6.1 | ||
## [v1.5.0] | ||
@@ -2,0 +10,0 @@ > Jan 12, 2016 |
10
index.js
@@ -28,2 +28,11 @@ /* | ||
function globalize () { | ||
// Idempotency | ||
if (global.navigator && | ||
global.navigator.userAgent && | ||
global.navigator.userAgent.indexOf('Node.js') > -1 && | ||
global.document && | ||
typeof global.document.destroy === 'function') { | ||
return global.document.destroy | ||
} | ||
var jsdom = require('jsdom') | ||
@@ -43,2 +52,3 @@ var document = jsdom.jsdom(html) | ||
window.console = global.console | ||
document.destroy = cleanup | ||
@@ -45,0 +55,0 @@ function cleanup () { |
{ | ||
"name": "jsdom-global", | ||
"version": "1.5.0", | ||
"version": "1.6.1", | ||
"description": "Enable DOM in Node.js", | ||
@@ -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
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
7079
77