async-listener
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -81,3 +81,3 @@ var wrap = require('shimmer').wrap; | ||
function wrapCallback(original) { | ||
var list = [].slice.call(listeners); | ||
var list = listeners.slice(); | ||
var length = list.length; | ||
@@ -84,0 +84,0 @@ for (var i = 0; i < length; ++i) { |
23
index.js
@@ -143,4 +143,23 @@ 'use strict'; | ||
// Wrap zlib streams | ||
var zProto = Object.getPrototypeOf(require('zlib').Deflate.prototype); | ||
wrap(zProto, "_transform", activator); | ||
var zlib; | ||
try { zlib = require('zlib'); } catch (err) { } | ||
if (zlib && zlib.Deflate && zlib.Deflate.prototype) { | ||
var proto = Object.getPrototypeOf(zlib.Deflate.prototype); | ||
if (proto._transform) { | ||
// streams2 | ||
wrap(proto, "_transform", activator); | ||
} | ||
else if (proto.write && proto.flush && proto.end) { | ||
// plain ol' streams | ||
massWrap( | ||
proto, | ||
[ | ||
'write', | ||
'flush', | ||
'end' | ||
], | ||
activator | ||
); | ||
} | ||
} | ||
@@ -147,0 +166,0 @@ // Wrap Crypto |
{ | ||
"name": "async-listener", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Polyfill exporting trevnorris's 0.11+ process.addAsynListener API.", | ||
@@ -5,0 +5,0 @@ "author": "Forrest L Norvell <ogd@aoaioxxysz.net>", |
@@ -8,9 +8,4 @@ 'use strict'; | ||
if (process.addAsyncListener) { | ||
t.fail("this package is meant nodes without core support for async listeners"); | ||
return t.end(); | ||
} | ||
if (!process.addAsyncListener) require('../index.js'); | ||
require('../index.js'); | ||
t.ok(process.createAsyncListener, "can create async listeners"); | ||
@@ -17,0 +12,0 @@ var counted = 0; |
@@ -23,9 +23,4 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
if (process.addAsyncListener) { | ||
console.error("meant for nodes without core support for async listeners"); | ||
process.exit(1); | ||
} | ||
if (!process.addAsyncListener) require('../index.js'); | ||
require('../index.js'); | ||
var assert = require('assert'); | ||
@@ -32,0 +27,0 @@ var fs = require('fs'); |
@@ -23,9 +23,4 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
if (process.addAsyncListener) { | ||
console.error("meant for nodes without core support for async listeners"); | ||
process.exit(1); | ||
} | ||
if (!process.addAsyncListener) require('../index.js'); | ||
require('../index.js'); | ||
var assert = require('assert'); | ||
@@ -32,0 +27,0 @@ var net = require('net'); |
@@ -23,9 +23,4 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
if (process.addAsyncListener) { | ||
console.error("meant for nodes without core support for async listeners"); | ||
process.exit(1); | ||
} | ||
if (!process.addAsyncListener) require('../index.js'); | ||
require('../index.js'); | ||
var assert = require('assert'); | ||
@@ -32,0 +27,0 @@ var net = require('net'); |
@@ -23,9 +23,4 @@ // Copyright Joyent, Inc. and other Node contributors. | ||
if (process.addAsyncListener) { | ||
console.error("meant for nodes without core support for async listeners"); | ||
process.exit(1); | ||
} | ||
if (!process.addAsyncListener) require('../index.js'); | ||
require('../index.js'); | ||
var assert = require('assert'); | ||
@@ -32,0 +27,0 @@ var net = require('net'); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
32062
13
981
6