diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-26 17:04:35 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-26 17:04:55 +0100 |
commit | a851c3fb33335fb42de8280c6bad2a6699bb746f (patch) | |
tree | bbaea1b873ccdcbb453fdbb783fdc594da124909 /node_modules/duplexify | |
parent | 5c17f4b61e8caaa365339c4916222a5892b2ec3a (diff) | |
download | wallet-core-a851c3fb33335fb42de8280c6bad2a6699bb746f.tar.xz |
update node_modules
Diffstat (limited to 'node_modules/duplexify')
9 files changed, 0 insertions, 333 deletions
diff --git a/node_modules/duplexify/node_modules/end-of-stream/.npmignore b/node_modules/duplexify/node_modules/end-of-stream/.npmignore deleted file mode 100644 index 3c3629e64..000000000 --- a/node_modules/duplexify/node_modules/end-of-stream/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/duplexify/node_modules/end-of-stream/README.md b/node_modules/duplexify/node_modules/end-of-stream/README.md deleted file mode 100644 index df800c1eb..000000000 --- a/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/node_modules/duplexify/node_modules/end-of-stream/index.js b/node_modules/duplexify/node_modules/end-of-stream/index.js deleted file mode 100644 index 9f61ed5af..000000000 --- a/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/node_modules/duplexify/node_modules/end-of-stream/package.json b/node_modules/duplexify/node_modules/end-of-stream/package.json deleted file mode 100644 index 5e36241b5..000000000 --- a/node_modules/duplexify/node_modules/end-of-stream/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "end-of-stream", - "version": "1.0.0", - "description": "Call a callback when a readable/writable/duplex stream has completed or failed.", - "repository": { - "type": "git", - "url": "git://github.com/mafintosh/end-of-stream.git" - }, - "dependencies": { - "once": "~1.3.0" - }, - "scripts": { - "test": "node test.js" - }, - "keywords": [ - "stream", - "streams", - "callback", - "finish", - "close", - "end", - "wait" - ], - "bugs": { - "url": "https://github.com/mafintosh/end-of-stream/issues" - }, - "homepage": "https://github.com/mafintosh/end-of-stream", - "main": "index.js", - "author": "Mathias Buus <mathiasbuus@gmail.com>", - "license": "MIT" -} diff --git a/node_modules/duplexify/node_modules/end-of-stream/test.js b/node_modules/duplexify/node_modules/end-of-stream/test.js deleted file mode 100644 index d4d126fe5..000000000 --- a/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/node_modules/duplexify/node_modules/once/LICENSE b/node_modules/duplexify/node_modules/once/LICENSE deleted file mode 100644 index 19129e315..000000000 --- a/node_modules/duplexify/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/node_modules/duplexify/node_modules/once/README.md b/node_modules/duplexify/node_modules/once/README.md deleted file mode 100644 index a2981ea07..000000000 --- a/node_modules/duplexify/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/node_modules/duplexify/node_modules/once/once.js b/node_modules/duplexify/node_modules/once/once.js deleted file mode 100644 index 2e1e721bf..000000000 --- a/node_modules/duplexify/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/node_modules/duplexify/node_modules/once/package.json b/node_modules/duplexify/node_modules/once/package.json deleted file mode 100644 index 28fe2ff72..000000000 --- a/node_modules/duplexify/node_modules/once/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "once", - "version": "1.3.3", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" - }, - "dependencies": { - "wrappy": "1" - }, - "devDependencies": { - "tap": "^1.2.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "files": [ - "once.js" - ], - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once" - }, - "keywords": [ - "once", - "function", - "one", - "single" - ], - "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)", - "license": "ISC" -} |