diff options
Diffstat (limited to 'deps/npm/node_modules/mississippi/node_modules')
37 files changed, 524 insertions, 509 deletions
diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json index 3ec39aba0e..3d8b508cf9 100644 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json @@ -1,7 +1,8 @@ { "_from": "concat-stream@^1.5.0", - "_id": "concat-stream@1.6.0", - "_integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "_id": "concat-stream@1.6.1", + "_inBundle": false, + "_integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", "_location": "/mississippi/concat-stream", "_phantomChildren": {}, "_requested": { @@ -17,16 +18,14 @@ "_requiredBy": [ "/mississippi" ], - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "_shasum": "0aac662fd52be78964d5532f694784e70110acf7", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", + "_shasum": "261b8f518301f1d834e36342b9fea095d2620a26", "_spec": "concat-stream@^1.5.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", "author": { "name": "Max Ogden", "email": "max@maxogden.com" }, - "bin": null, "bugs": { "url": "http://github.com/maxogden/concat-stream/issues" }, @@ -51,8 +50,6 @@ "license": "MIT", "main": "index.js", "name": "concat-stream", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+ssh://git@github.com/maxogden/concat-stream.git" @@ -82,5 +79,5 @@ "android-browser/4.2..latest" ] }, - "version": "1.6.0" + "version": "1.6.1" } diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/.npmignore b/deps/npm/node_modules/mississippi/node_modules/duplexify/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md b/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md index 27669f6b6b..8352900fc6 100644 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md +++ b/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md @@ -46,7 +46,7 @@ If you call `setReadable` or `setWritable` multiple times it will unregister the To disable the readable or writable part call `setReadable` or `setWritable` with `null`. If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event. -You can also explictly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an +You can also explicitly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an error object as argument, in which case the error is emitted as part of the `error` event. ``` js diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js b/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js index a04f124fa9..8323e654ac 100644 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js @@ -3,7 +3,9 @@ var eos = require('end-of-stream') var inherits = require('inherits') var shift = require('stream-shift') -var SIGNAL_FLUSH = new Buffer([0]) +var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from) + ? Buffer.from([0]) + : new Buffer([0]) var onuncork = function(self, fn) { if (self._corked) self.once('uncork', fn) @@ -12,7 +14,7 @@ var onuncork = function(self, fn) { var destroyer = function(self, end) { return function(err) { - if (err) self.destroy(err.message === 'premature close' ? null : err) + if (err) self._destroyInterval(err) else if (end && !self._ended) self.end() } } @@ -46,6 +48,8 @@ var Duplexify = function(writable, readable, opts) { this._unwrite = null this._unread = null this._ended = false + this._error = null + this._preferError = false this.destroyed = false @@ -167,15 +171,24 @@ Duplexify.prototype._forward = function() { } Duplexify.prototype.destroy = function(err) { + if (this._preferError && !this._error && err) this._error = err + if (this.destroyed) return this.destroyed = true var self = this process.nextTick(function() { - self._destroy(err) + self._destroy(self._preferError ? self._error : err) }) } +Duplexify.prototype._destroyInterval = function(err) { + if (this.destroyed) return + if (err.message !== 'premature close') return this.destroy(err) + this._preferError = true + this.destroy(null) +} + Duplexify.prototype._destroy = function(err) { if (err) { var ondrain = this._ondrain diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/.npmignore b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/README.md b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/README.md deleted file mode 100644 index df800c1eb6..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# end-of-stream - -A node module that calls a callback when a readable/writable/duplex stream has completed or failed. - - npm install end-of-stream - -## Usage - -Simply pass a stream and a callback to the `eos`. -Both legacy streams and streams2 are supported. - -``` js -var eos = require('end-of-stream'); - -eos(readableStream, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has ended'); -}); - -eos(writableStream, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has finished'); -}); - -eos(duplexStream, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has ended and finished'); -}); - -eos(duplexStream, {readable:false}, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has ended but might still be writable'); -}); - -eos(duplexStream, {writable:false}, function(err) { - if (err) return console.log('stream had an error or closed early'); - console.log('stream has ended but might still be readable'); -}); - -eos(readableStream, {error:false}, function(err) { - // do not treat emit('error', err) as a end-of-stream -}); -``` - -## License - -MIT
\ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/index.js b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/index.js deleted file mode 100644 index 9f61ed5af9..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/index.js +++ /dev/null @@ -1,72 +0,0 @@ -var once = require('once'); - -var noop = function() {}; - -var isRequest = function(stream) { - return stream.setHeader && typeof stream.abort === 'function'; -}; - -var eos = function(stream, opts, callback) { - if (typeof opts === 'function') return eos(stream, null, opts); - if (!opts) opts = {}; - - callback = once(callback || noop); - - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || (opts.readable !== false && stream.readable); - var writable = opts.writable || (opts.writable !== false && stream.writable); - - var onlegacyfinish = function() { - if (!stream.writable) onfinish(); - }; - - var onfinish = function() { - writable = false; - if (!readable) callback(); - }; - - var onend = function() { - readable = false; - if (!writable) callback(); - }; - - var onclose = function() { - if (readable && !(rs && rs.ended)) return callback(new Error('premature close')); - if (writable && !(ws && ws.ended)) return callback(new Error('premature close')); - }; - - var onrequest = function() { - stream.req.on('finish', onfinish); - }; - - if (isRequest(stream)) { - stream.on('complete', onfinish); - stream.on('abort', onclose); - if (stream.req) onrequest(); - else stream.on('request', onrequest); - } else if (writable && !ws) { // legacy streams - stream.on('end', onlegacyfinish); - stream.on('close', onlegacyfinish); - } - - stream.on('end', onend); - stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', callback); - stream.on('close', onclose); - - return function() { - stream.removeListener('complete', onfinish); - stream.removeListener('abort', onclose); - stream.removeListener('request', onrequest); - if (stream.req) stream.req.removeListener('finish', onfinish); - stream.removeListener('end', onlegacyfinish); - stream.removeListener('close', onlegacyfinish); - stream.removeListener('finish', onfinish); - stream.removeListener('end', onend); - stream.removeListener('error', callback); - stream.removeListener('close', onclose); - }; -}; - -module.exports = eos;
\ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/LICENSE b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/LICENSE deleted file mode 100644 index 19129e315f..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/README.md b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/README.md deleted file mode 100644 index a2981ea070..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# once - -Only call a function once. - -## usage - -```javascript -var once = require('once') - -function load (file, cb) { - cb = once(cb) - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Or add to the Function.prototype in a responsible way: - -```javascript -// only has to be done once -require('once').proto() - -function load (file, cb) { - cb = cb.once() - loader.load('file') - loader.once('load', cb) - loader.once('error', cb) -} -``` - -Ironically, the prototype feature makes this module twice as -complicated as necessary. - -To check whether you function has been called, use `fn.called`. Once the -function is called for the first time the return value of the original -function is saved in `fn.value` and subsequent calls will continue to -return this value. - -```javascript -var once = require('once') - -function load (cb) { - cb = once(cb) - var stream = createStream() - stream.once('data', cb) - stream.once('end', function () { - if (!cb.called) cb(new Error('not found')) - }) -} -``` diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/once.js b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/once.js deleted file mode 100644 index 2e1e721bfe..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/once.js +++ /dev/null @@ -1,21 +0,0 @@ -var wrappy = require('wrappy') -module.exports = wrappy(once) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/package.json b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/package.json deleted file mode 100644 index 8c0e6e2991..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/node_modules/once/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_from": "once@~1.3.0", - "_id": "once@1.3.3", - "_integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "_location": "/mississippi/duplexify/end-of-stream/once", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "once@~1.3.0", - "name": "once", - "escapedName": "once", - "rawSpec": "~1.3.0", - "saveSpec": null, - "fetchSpec": "~1.3.0" - }, - "_requiredBy": [ - "/mississippi/duplexify/end-of-stream" - ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", - "_shrinkwrap": null, - "_spec": "once@~1.3.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bin": null, - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "bundleDependencies": false, - "dependencies": { - "wrappy": "1" - }, - "deprecated": false, - "description": "Run a function exactly one time", - "devDependencies": { - "tap": "^1.2.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "once.js" - ], - "homepage": "https://github.com/isaacs/once#readme", - "keywords": [ - "once", - "function", - "one", - "single" - ], - "license": "ISC", - "main": "once.js", - "name": "once", - "optionalDependencies": {}, - "peerDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.3.3" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/package.json b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/package.json deleted file mode 100644 index 433faa2e6c..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "end-of-stream@1.0.0", - "_id": "end-of-stream@1.0.0", - "_integrity": "sha1-1FlucCc0qT5A6a+GQxnqvZn/Lw4=", - "_location": "/mississippi/duplexify/end-of-stream", - "_phantomChildren": { - "wrappy": "1.0.2" - }, - "_requested": { - "type": "version", - "registry": true, - "raw": "end-of-stream@1.0.0", - "name": "end-of-stream", - "escapedName": "end-of-stream", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/mississippi/duplexify" - ], - "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", - "_shasum": "d4596e702734a93e40e9af864319eabd99ff2f0e", - "_shrinkwrap": null, - "_spec": "end-of-stream@1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/duplexify", - "author": { - "name": "Mathias Buus", - "email": "mathiasbuus@gmail.com" - }, - "bin": null, - "bugs": { - "url": "https://github.com/mafintosh/end-of-stream/issues" - }, - "bundleDependencies": false, - "dependencies": { - "once": "~1.3.0" - }, - "deprecated": false, - "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", - "devDependencies": {}, - "homepage": "https://github.com/mafintosh/end-of-stream", - "keywords": [ - "stream", - "streams", - "callback", - "finish", - "close", - "end", - "wait" - ], - "license": "MIT", - "main": "index.js", - "name": "end-of-stream", - "optionalDependencies": {}, - "peerDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/end-of-stream.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/test.js b/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/test.js deleted file mode 100644 index d4d126fe56..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/node_modules/end-of-stream/test.js +++ /dev/null @@ -1,62 +0,0 @@ -var assert = require('assert'); -var eos = require('./index'); - -var expected = 6; -var fs = require('fs'); -var net = require('net'); - -var ws = fs.createWriteStream('/dev/null'); -eos(ws, function(err) { - expected--; - assert(!!err); - if (!expected) process.exit(0); -}); -ws.close(); - -var rs = fs.createReadStream('/dev/random'); -eos(rs, function(err) { - expected--; - assert(!!err); - if (!expected) process.exit(0); -}); -rs.close(); - -var rs = fs.createReadStream(__filename); -eos(rs, function(err) { - expected--; - assert(!err); - if (!expected) process.exit(0); -}); -rs.pipe(fs.createWriteStream('/dev/null')); - -var rs = fs.createReadStream(__filename); -eos(rs, function(err) { - throw new Error('no go') -})(); -rs.pipe(fs.createWriteStream('/dev/null')); - -var socket = net.connect(50000); -eos(socket, function(err) { - expected--; - assert(!!err); - if (!expected) process.exit(0); -}); - -var server = net.createServer(function(socket) { - eos(socket, function() { - expected--; - if (!expected) process.exit(0); - }); - socket.destroy(); -}).listen(30000, function() { - var socket = net.connect(30000); - eos(socket, function() { - expected--; - if (!expected) process.exit(0); - }); -}); - -setTimeout(function() { - assert(expected === 0); - process.exit(0); -}, 1000); diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json b/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json index 2249d135e5..ed3ea4ab17 100644 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json @@ -1,11 +1,10 @@ { "_from": "duplexify@^3.4.2", - "_id": "duplexify@3.5.0", - "_integrity": "sha1-GqdzAC4VeEV+nZ1KULDMquvL1gQ=", + "_id": "duplexify@3.5.4", + "_inBundle": false, + "_integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", "_location": "/mississippi/duplexify", - "_phantomChildren": { - "wrappy": "1.0.2" - }, + "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, @@ -20,21 +19,19 @@ "/mississippi", "/mississippi/pumpify" ], - "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", - "_shasum": "1aa773002e1578457e9d9d4a50b0ccaaebcbd604", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", + "_shasum": "4bb46c1796eabebeec4ca9a2e66b808cb7a3d8b4", "_spec": "duplexify@^3.4.2", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", "author": { "name": "Mathias Buus" }, - "bin": null, "bugs": { "url": "https://github.com/mafintosh/duplexify/issues" }, "bundleDependencies": false, "dependencies": { - "end-of-stream": "1.0.0", + "end-of-stream": "^1.0.0", "inherits": "^2.0.1", "readable-stream": "^2.0.0", "stream-shift": "^1.0.0" @@ -42,9 +39,9 @@ "deprecated": false, "description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input", "devDependencies": { - "concat-stream": "^1.4.6", - "tape": "^2.13.3", - "through2": "^0.5.1" + "concat-stream": "^1.5.2", + "tape": "^4.0.0", + "through2": "^2.0.0" }, "homepage": "https://github.com/mafintosh/duplexify", "keywords": [ @@ -59,8 +56,6 @@ "license": "MIT", "main": "index.js", "name": "duplexify", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/mafintosh/duplexify.git" @@ -68,5 +63,5 @@ "scripts": { "test": "tape test.js" }, - "version": "3.5.0" + "version": "3.5.4" } diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/test.js b/deps/npm/node_modules/mississippi/node_modules/duplexify/test.js index f4856d39ea..4330e93cf0 100644 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/test.js +++ b/deps/npm/node_modules/mississippi/node_modules/duplexify/test.js @@ -260,7 +260,6 @@ tape('prefinish not twice', function(t) { tape('close', function(t) { var passthrough = through() var dup = duplexify(passthrough, passthrough) - var ok = false passthrough.emit('close') dup.on('close', function() { diff --git a/deps/npm/node_modules/mississippi/node_modules/end-of-stream/index.js b/deps/npm/node_modules/mississippi/node_modules/end-of-stream/index.js index b3a9068634..be426c227c 100644 --- a/deps/npm/node_modules/mississippi/node_modules/end-of-stream/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/end-of-stream/index.js @@ -39,6 +39,10 @@ var eos = function(stream, opts, callback) { callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); }; + var onerror = function(err) { + callback.call(stream, err); + }; + var onclose = function() { if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close')); if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close')); @@ -62,7 +66,7 @@ var eos = function(stream, opts, callback) { stream.on('end', onend); stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', callback); + if (opts.error !== false) stream.on('error', onerror); stream.on('close', onclose); return function() { @@ -75,7 +79,7 @@ var eos = function(stream, opts, callback) { stream.removeListener('finish', onfinish); stream.removeListener('exit', onexit); stream.removeListener('end', onend); - stream.removeListener('error', callback); + stream.removeListener('error', onerror); stream.removeListener('close', onclose); }; }; diff --git a/deps/npm/node_modules/mississippi/node_modules/end-of-stream/package.json b/deps/npm/node_modules/mississippi/node_modules/end-of-stream/package.json index 5610bee443..4af362d2b1 100644 --- a/deps/npm/node_modules/mississippi/node_modules/end-of-stream/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/end-of-stream/package.json @@ -1,7 +1,8 @@ { "_from": "end-of-stream@^1.1.0", - "_id": "end-of-stream@1.4.0", - "_integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", + "_id": "end-of-stream@1.4.1", + "_inBundle": false, + "_integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "_location": "/mississippi/end-of-stream", "_phantomChildren": {}, "_requested": { @@ -16,19 +17,18 @@ }, "_requiredBy": [ "/mississippi", + "/mississippi/duplexify", "/mississippi/pump", "/mississippi/stream-each" ], - "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", - "_shasum": "7a90d833efda6cfa6eac0f4949dbb0fad3a63206", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "_shasum": "ed29634d19baba463b6ce6b80a37213eab71ec43", "_spec": "end-of-stream@^1.1.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", "author": { "name": "Mathias Buus", "email": "mathiasbuus@gmail.com" }, - "bin": null, "bugs": { "url": "https://github.com/mafintosh/end-of-stream/issues" }, @@ -38,7 +38,6 @@ }, "deprecated": false, "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", - "devDependencies": {}, "files": [ "index.js" ], @@ -55,8 +54,6 @@ "license": "MIT", "main": "index.js", "name": "end-of-stream", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/mafintosh/end-of-stream.git" @@ -64,5 +61,5 @@ "scripts": { "test": "node test.js" }, - "version": "1.4.0" + "version": "1.4.1" } diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/.npmignore b/deps/npm/node_modules/mississippi/node_modules/pump/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/pump/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/README.md b/deps/npm/node_modules/mississippi/node_modules/pump/README.md index 5029b27d68..4c81471a0e 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pump/README.md +++ b/deps/npm/node_modules/mississippi/node_modules/pump/README.md @@ -47,6 +47,15 @@ pump(source, transform, anotherTransform, dest, function(err) { If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. +Similarly to `stream.pipe()`, `pump()` returns the last stream passed in, so you can do: + +``` +return pump(s1, s2) // returns s2 +``` + +If you want to return a stream that combines *both* s1 and s2 to a single stream use +[pumpify](https://github.com/mafintosh/pumpify) instead. + ## License MIT diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/index.js b/deps/npm/node_modules/mississippi/node_modules/pump/index.js index 060ce5f4fd..c15059f176 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pump/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/pump/index.js @@ -3,12 +3,14 @@ var eos = require('end-of-stream') var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes var noop = function () {} +var ancient = /^v?\.0/.test(process.version) var isFn = function (fn) { return typeof fn === 'function' } var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way if (!fs) return false // browser return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } @@ -37,7 +39,7 @@ var destroyer = function (stream, reading, writing, callback) { if (destroyed) return destroyed = true - if (isFS(stream)) return stream.close() // use close for fs streams to avoid fd leaks + if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want if (isFn(stream.destroy)) return stream.destroy() diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/package.json b/deps/npm/node_modules/mississippi/node_modules/pump/package.json index 2ec8b797bc..6e62ee06cd 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pump/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/pump/package.json @@ -1,33 +1,31 @@ { - "_from": "pump@^1.0.0", - "_id": "pump@1.0.2", - "_integrity": "sha1-Oz7mUS+U8OV1U4wXmV+fFpkKXVE=", + "_from": "pump@^3.0.0", + "_id": "pump@3.0.0", + "_inBundle": false, + "_integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "_location": "/mississippi/pump", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "pump@^1.0.0", + "raw": "pump@^3.0.0", "name": "pump", "escapedName": "pump", - "rawSpec": "^1.0.0", + "rawSpec": "^3.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "^3.0.0" }, "_requiredBy": [ - "/mississippi", - "/mississippi/pumpify" + "/mississippi" ], - "_resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz", - "_shasum": "3b3ee6512f94f0e575538c17995f9f16990a5d51", - "_shrinkwrap": null, - "_spec": "pump@^1.0.0", + "_resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "_shasum": "b4a2116815bde2f4e1ea602354e8c75565107a64", + "_spec": "pump@^3.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", "author": { "name": "Mathias Buus Madsen", "email": "mathiasbuus@gmail.com" }, - "bin": null, "browser": { "fs": false }, @@ -41,7 +39,6 @@ }, "deprecated": false, "description": "pipe streams together and close all of them if one of them closes", - "devDependencies": {}, "homepage": "https://github.com/mafintosh/pump#readme", "keywords": [ "streams", @@ -51,14 +48,12 @@ ], "license": "MIT", "name": "pump", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/mafintosh/pump.git" }, "scripts": { - "test": "node test.js" + "test": "node test-browser.js && node test-node.js" }, - "version": "1.0.2" + "version": "3.0.0" } diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/test-browser.js b/deps/npm/node_modules/mississippi/node_modules/pump/test-browser.js index 80e852c7dc..9a06c8a4cc 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pump/test-browser.js +++ b/deps/npm/node_modules/mississippi/node_modules/pump/test-browser.js @@ -30,7 +30,10 @@ var rsClosed = false var callbackCalled = false var check = function () { - if (wsClosed && rsClosed && callbackCalled) console.log('done') + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-browser.js passes') + clearTimeout(timeout) + } } ws.on('finish', function () { @@ -43,16 +46,21 @@ rs.on('end', function () { check() }) -pump(rs, toHex(), toHex(), toHex(), ws, function () { +var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { callbackCalled = true check() }) +if (res !== ws) { + throw new Error('should return last stream') +} + setTimeout(function () { rs.push(null) rs.emit('close') }, 1000) -setTimeout(function () { - if (!check()) throw new Error('timeout') +var timeout = setTimeout(function () { + check() + throw new Error('timeout') }, 5000) diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/test-node.js b/deps/npm/node_modules/mississippi/node_modules/pump/test-node.js new file mode 100644 index 0000000000..561251a082 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pump/test-node.js @@ -0,0 +1,53 @@ +var pump = require('./index') + +var rs = require('fs').createReadStream('/dev/random') +var ws = require('fs').createWriteStream('/dev/null') + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-node.js passes') + clearTimeout(timeout) + } +} + +ws.on('close', function () { + wsClosed = true + check() +}) + +rs.on('close', function () { + rsClosed = true + check() +}) + +var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +if (res !== ws) { + throw new Error('should return last stream') +} + +setTimeout(function () { + rs.destroy() +}, 1000) + +var timeout = setTimeout(function () { + throw new Error('timeout') +}, 5000) diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/.npmignore b/deps/npm/node_modules/mississippi/node_modules/pumpify/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/pumpify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/index.js b/deps/npm/node_modules/mississippi/node_modules/pumpify/index.js index 147de675c3..45bb987e85 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pumpify/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/index.js @@ -53,3 +53,4 @@ var define = function(opts) { module.exports = define({destroy:false}) module.exports.obj = define({destroy:false, objectMode:true, highWaterMark:16}) +module.exports.ctor = define diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/.travis.yml b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/.travis.yml new file mode 100644 index 0000000000..17f94330e7 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + +script: "npm test" diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/LICENSE b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/LICENSE new file mode 100644 index 0000000000..757562ec59 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
\ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/README.md b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/README.md new file mode 100644 index 0000000000..5029b27d68 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/README.md @@ -0,0 +1,56 @@ +# pump + +pump is a small node module that pipes streams together and destroys all of them if one of them closes. + +``` +npm install pump +``` + +[![build status](http://img.shields.io/travis/mafintosh/pump.svg?style=flat)](http://travis-ci.org/mafintosh/pump) + +## What problem does it solve? + +When using standard `source.pipe(dest)` source will _not_ be destroyed if dest emits close or an error. +You are also not able to provide a callback to tell when then pipe has finished. + +pump does these two things for you + +## Usage + +Simply pass the streams you want to pipe together to pump and add an optional callback + +``` js +var pump = require('pump') +var fs = require('fs') + +var source = fs.createReadStream('/dev/random') +var dest = fs.createWriteStream('/dev/null') + +pump(source, dest, function(err) { + console.log('pipe finished', err) +}) + +setTimeout(function() { + dest.destroy() // when dest is closed pump will destroy source +}, 1000) +``` + +You can use pump to pipe more than two streams together as well + +``` js +var transform = someTransformStream() + +pump(source, transform, anotherTransform, dest, function(err) { + console.log('pipe finished', err) +}) +``` + +If `source`, `transform`, `anotherTransform` or `dest` closes all of them will be destroyed. + +## License + +MIT + +## Related + +`pump` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/index.js b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/index.js new file mode 100644 index 0000000000..d9ca0335cb --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/index.js @@ -0,0 +1,82 @@ +var once = require('once') +var eos = require('end-of-stream') +var fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes + +var noop = function () {} +var ancient = /^v?\.0/.test(process.version) + +var isFn = function (fn) { + return typeof fn === 'function' +} + +var isFS = function (stream) { + if (!ancient) return false // newer node version do not need to care about fs is a special way + if (!fs) return false // browser + return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) +} + +var isRequest = function (stream) { + return stream.setHeader && isFn(stream.abort) +} + +var destroyer = function (stream, reading, writing, callback) { + callback = once(callback) + + var closed = false + stream.on('close', function () { + closed = true + }) + + eos(stream, {readable: reading, writable: writing}, function (err) { + if (err) return callback(err) + closed = true + callback() + }) + + var destroyed = false + return function (err) { + if (closed) return + if (destroyed) return + destroyed = true + + if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks + if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want + + if (isFn(stream.destroy)) return stream.destroy() + + callback(err || new Error('stream was destroyed')) + } +} + +var call = function (fn) { + fn() +} + +var pipe = function (from, to) { + return from.pipe(to) +} + +var pump = function () { + var streams = Array.prototype.slice.call(arguments) + var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop + + if (Array.isArray(streams[0])) streams = streams[0] + if (streams.length < 2) throw new Error('pump requires two streams per minimum') + + var error + var destroys = streams.map(function (stream, i) { + var reading = i < streams.length - 1 + var writing = i > 0 + return destroyer(stream, reading, writing, function (err) { + if (!error) error = err + if (err) destroys.forEach(call) + if (reading) return + destroys.forEach(call) + callback(error) + }) + }) + + streams.reduce(pipe) +} + +module.exports = pump diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/package.json b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/package.json new file mode 100644 index 0000000000..ebd36d7415 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/package.json @@ -0,0 +1,59 @@ +{ + "_from": "pump@^2.0.0", + "_id": "pump@2.0.1", + "_inBundle": false, + "_integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "_location": "/mississippi/pumpify/pump", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pump@^2.0.0", + "name": "pump", + "escapedName": "pump", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/mississippi/pumpify" + ], + "_resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "_shasum": "12399add6e4cf7526d973cbc8b5ce2e2908b3909", + "_spec": "pump@^2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/pumpify", + "author": { + "name": "Mathias Buus Madsen", + "email": "mathiasbuus@gmail.com" + }, + "browser": { + "fs": false + }, + "bugs": { + "url": "https://github.com/mafintosh/pump/issues" + }, + "bundleDependencies": false, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + }, + "deprecated": false, + "description": "pipe streams together and close all of them if one of them closes", + "homepage": "https://github.com/mafintosh/pump#readme", + "keywords": [ + "streams", + "pipe", + "destroy", + "callback" + ], + "license": "MIT", + "name": "pump", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/pump.git" + }, + "scripts": { + "test": "node test-browser.js && node test-node.js" + }, + "version": "2.0.1" +} diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/test-browser.js b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/test-browser.js new file mode 100644 index 0000000000..75ea4a292e --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/test-browser.js @@ -0,0 +1,62 @@ +var stream = require('stream') +var pump = require('./index') + +var rs = new stream.Readable() +var ws = new stream.Writable() + +rs._read = function (size) { + this.push(Buffer(size).fill('abc')) +} + +ws._write = function (chunk, encoding, cb) { + setTimeout(function () { + cb() + }, 100) +} + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-browser.js passes') + clearTimeout(timeout) + } +} + +ws.on('finish', function () { + wsClosed = true + check() +}) + +rs.on('end', function () { + rsClosed = true + check() +}) + +pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +setTimeout(function () { + rs.push(null) + rs.emit('close') +}, 1000) + +var timeout = setTimeout(function () { + check() + throw new Error('timeout') +}, 5000) diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/test.js b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/test-node.js index 64e772ca5b..034a65414d 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pump/test.js +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/node_modules/pump/test-node.js @@ -19,7 +19,10 @@ var rsClosed = false var callbackCalled = false var check = function () { - if (wsClosed && rsClosed && callbackCalled) process.exit(0) + if (wsClosed && rsClosed && callbackCalled) { + console.log('test-node.js passes') + clearTimeout(timeout) + } } ws.on('close', function () { @@ -32,15 +35,19 @@ rs.on('close', function () { check() }) -pump(rs, toHex(), toHex(), toHex(), ws, function () { +var res = pump(rs, toHex(), toHex(), toHex(), ws, function () { callbackCalled = true check() }) +if (res) { + process.exit(1) +} + setTimeout(function () { rs.destroy() }, 1000) -setTimeout(function () { +var timeout = setTimeout(function () { throw new Error('timeout') }, 5000) diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/package.json b/deps/npm/node_modules/mississippi/node_modules/pumpify/package.json index 8bb5cbd0c9..f2be43f0b9 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pumpify/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/package.json @@ -1,7 +1,8 @@ { "_from": "pumpify@^1.3.3", - "_id": "pumpify@1.3.5", - "_integrity": "sha1-G2ccYZlAq8rqwK0OOjwWS+dgmTs=", + "_id": "pumpify@1.4.0", + "_inBundle": false, + "_integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", "_location": "/mississippi/pumpify", "_phantomChildren": {}, "_requested": { @@ -17,29 +18,27 @@ "_requiredBy": [ "/mississippi" ], - "_resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.3.5.tgz", - "_shasum": "1b671c619940abcaeac0ad0e3a3c164be760993b", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", + "_shasum": "80b7c5df7e24153d03f0e7ac8a05a5d068bd07fb", "_spec": "pumpify@^1.3.3", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", "author": { "name": "Mathias Buus" }, - "bin": null, "bugs": { "url": "https://github.com/mafintosh/pumpify/issues" }, "bundleDependencies": false, "dependencies": { - "duplexify": "^3.1.2", - "inherits": "^2.0.1", - "pump": "^1.0.0" + "duplexify": "^3.5.3", + "inherits": "^2.0.3", + "pump": "^2.0.0" }, "deprecated": false, "description": "Combine an array of streams into a single duplex stream using pump and duplexify", "devDependencies": { - "tape": "^2.13.3", - "through2": "^0.5.1" + "tape": "^4.8.0", + "through2": "^2.0.3" }, "homepage": "https://github.com/mafintosh/pumpify", "keywords": [ @@ -54,8 +53,6 @@ "license": "MIT", "main": "index.js", "name": "pumpify", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/mafintosh/pumpify.git" @@ -63,5 +60,5 @@ "scripts": { "test": "tape test.js" }, - "version": "1.3.5" + "version": "1.4.0" } diff --git a/deps/npm/node_modules/mississippi/node_modules/pumpify/test.js b/deps/npm/node_modules/mississippi/node_modules/pumpify/test.js index 4ee91c5f3e..de6b16e346 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pumpify/test.js +++ b/deps/npm/node_modules/mississippi/node_modules/pumpify/test.js @@ -160,4 +160,22 @@ tape('early destroy', function(t) { setTimeout(function() { pipeline.setPipeline(a, b, c) }, 100) -})
\ No newline at end of file +}) + +tape('preserves error', function (t) { + var a = through() + var b = through(function (data, enc, cb) { + cb(new Error('stop')) + }) + var c = through() + var s = pumpify() + + s.on('error', function (err) { + t.same(err.message, 'stop') + t.end() + }) + + s.setPipeline(a, b, c) + s.resume() + s.write('hi') +}) diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js b/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js index 2c07e957a3..7e67f7337a 100644 --- a/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js @@ -8,6 +8,7 @@ function each (stream, fn, cb) { var error = null var ended = false var running = false + var calling = false stream.on('readable', onreadable) onreadable() @@ -35,20 +36,23 @@ function each (stream, fn, cb) { return } if (ended) return cb(error) - read() + if (!calling) read() } function read () { - if (ended || running) return - want = false - - var data = shift(stream) - if (!data) { - want = true - return + while (!running && !ended) { + want = false + + var data = shift(stream) + if (data === null) { + want = true + return + } + + running = true + calling = true + fn(data, afterRead) + calling = false } - - running = true - fn(data, afterRead) } } diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json b/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json index 39f4cd01f4..49b4df18e1 100644 --- a/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json @@ -1,7 +1,8 @@ { "_from": "stream-each@^1.1.0", - "_id": "stream-each@1.2.0", - "_integrity": "sha1-HpXUdXP1gNgU3A/4zQ9m8c5TyZE=", + "_id": "stream-each@1.2.2", + "_inBundle": false, + "_integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", "_location": "/mississippi/stream-each", "_phantomChildren": {}, "_requested": { @@ -17,16 +18,14 @@ "_requiredBy": [ "/mississippi" ], - "_resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.0.tgz", - "_shasum": "1e95d47573f580d814dc0ff8cd0f66f1ce53c991", - "_shrinkwrap": null, + "_resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", + "_shasum": "8e8c463f91da8991778765873fe4d960d8f616bd", "_spec": "stream-each@^1.1.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", "author": { "name": "Mathias Buus", "url": "@mafintosh" }, - "bin": null, "bugs": { "url": "https://github.com/mafintosh/stream-each/issues" }, @@ -46,8 +45,6 @@ "license": "MIT", "main": "index.js", "name": "stream-each", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git+https://github.com/mafintosh/stream-each.git" @@ -55,5 +52,5 @@ "scripts": { "test": "standard && tape test.js" }, - "version": "1.2.0" + "version": "1.2.2" } diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/test.js b/deps/npm/node_modules/mississippi/node_modules/stream-each/test.js index 36454c45eb..277634cd05 100644 --- a/deps/npm/node_modules/mississippi/node_modules/stream-each/test.js +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/test.js @@ -80,3 +80,43 @@ tape('each error and callback', function (t) { t.end() }) }) + +tape('each with falsey values', function (t) { + var s = through.obj() + s.write(0) + s.write(false) + s.write(undefined) + s.end() + + s.on('end', function () { + t.end() + }) + + var expected = [0, false] + var count = 0 + each(s, function (data, next) { + count++ + t.same(data, expected.shift()) + next() + }, function () { + t.same(count, 2) + }) +}) + +tape('huge stack', function (t) { + var s = through.obj() + + for (var i = 0; i < 5000; i++) { + s.write('foo') + } + + s.end() + + each(s, function (data, cb) { + if (data !== 'foo') t.fail('bad data') + cb() + }, function (err) { + t.error(err, 'no error') + t.end() + }) +}) |