Comparing version 5.0.7 to 5.0.8
@@ -0,1 +1,6 @@ | ||
## Version 5.0.8 2018-02-22 | ||
FIXED rerouting in Node 8 | ||
## Version 5.0.7 2017-06-26 | ||
@@ -2,0 +7,0 @@ |
@@ -73,3 +73,3 @@ 'use strict'; | ||
} | ||
} else if (typeof init === "object") _.each(init, function (value, name) { | ||
} else if (typeof init === 'object') _.each(init, function (value, name) { | ||
_this.append(name, value); | ||
@@ -76,0 +76,0 @@ }); |
@@ -13,2 +13,4 @@ // Domain routing and port forwarding | ||
var _Object$getOwnPropertySymbols = require('babel-runtime/core-js/object/get-own-property-symbols')['default']; | ||
var _Object$assign = require('babel-runtime/core-js/object/assign')['default']; | ||
@@ -71,24 +73,20 @@ | ||
Net.Socket.prototype.connect = function (options, callback) { | ||
if (Array.isArray(options) && options.some(function (opts) { | ||
return findTargetPort(opts.host, opts.port); | ||
})) { | ||
// we hackily update the array in place, because the array has already been extended with | ||
// extra methods | ||
options.forEach(function (opts, i) { | ||
var port = findTargetPort(opts.host, opts.port); | ||
if (port) options[i] = _Object$assign({}, opts, { host: 'localhost', port: port }); | ||
}); | ||
return connect.call(this, options, callback); | ||
} | ||
if (options && typeof options === 'object' && !Array.isArray(options)) { | ||
var port = findTargetPort(options.host, options.port); | ||
if (port) { | ||
options = _Object$assign({}, options, { host: 'localhost', port: port }); | ||
return connect.call(this, options, callback); | ||
} | ||
} | ||
return connect.apply(this, arguments); | ||
var hasNormalizedArgs = _Object$getOwnPropertySymbols && _Object$getOwnPropertySymbols(options).length > 0; | ||
var isNode8 = Array.isArray(options) && hasNormalizedArgs; | ||
if (isNode8) { | ||
var reroutedOptions = rerouteOptions(options[0]); | ||
callback = options[1]; | ||
return connect.call(this, reroutedOptions, callback); | ||
} else if (typeof options === 'object') { | ||
var reroutedOptions = rerouteOptions(options); | ||
return connect.call(this, reroutedOptions, callback); | ||
} else return connect.apply(this, arguments); | ||
}; | ||
} | ||
function rerouteOptions(options) { | ||
var port = findTargetPort(options.host, options.port); | ||
if (port) return _Object$assign({}, options, { host: 'localhost', port: port });else return options; | ||
} | ||
// source - Hostname or host:port (default to port 80) | ||
@@ -95,0 +93,0 @@ // target - Target port number |
{ | ||
"name": "zombie", | ||
"version": "5.0.7", | ||
"version": "5.0.8", | ||
"description": "Insanely fast, full-stack, headless browser testing using Node.js", | ||
@@ -5,0 +5,0 @@ "homepage": "https://www.npmjs.com/package/zombie", |
@@ -10,3 +10,3 @@ # Zombie.js | ||
**Zombie 5.x** is tested to work with node.js 4 or later. | ||
**Zombie 5.x** is tested to work with Node 4 or later. | ||
If you need to use Node 0.12 or earlier, consider using Zombie 2.x. | ||
@@ -13,0 +13,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
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
689783
49
6879
8
3