diff options
Diffstat (limited to 'deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate')
14 files changed, 0 insertions, 432 deletions
diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/.npmignore b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/.travis.yml b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/.travis.yml deleted file mode 100644 index 89d7548954..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.10" - - '0.12' - - 'iojs' diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/LICENSE b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/LICENSE deleted file mode 100644 index 66a4d2a149..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 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. diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/README.md b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/README.md deleted file mode 100644 index 001112045b..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# stream-iterate - -Iterate through the values in a stream. - -``` -npm install stream-iterate -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-iterate.svg?style=flat)](http://travis-ci.org/mafintosh/stream-iterate) - -## Usage - -``` js -var iterate = require('stream-iterate') -var from = require('from2') - -var stream = from.obj(['a', 'b', 'c']) - -var read = iterate(stream) - -loop() - -// recursively iterates through each item in the stream -function loop () { - read(function (err, data, next) { - console.log(err, data) - next() - loop() - }) -} -``` - -If you don't call `next` and call `read` again the same `(err, value)` pair will be returned. - -You can use this module to implement stuff like [a streaming merge sort](https://github.com/mafintosh/stream-iterate/blob/master/test.js#L5-L47). - -## License - -[MIT](LICENSE) diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/index.js b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/index.js deleted file mode 100644 index c60d6ab550..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/index.js +++ /dev/null @@ -1,70 +0,0 @@ -var Readable = require('readable-stream').Readable -var shift = require('stream-shift') - -var stream2 = function (stream) { - if (stream._readableState) return stream - return new Readable({objectMode: true, highWaterMark: 16}).wrap(stream) -} - -module.exports = function (stream) { - stream = stream2(stream) - - var ended = false - var data = null - var err = null - var destroyed = false - var fn = null - - var consume = function (e) { - if (e) { - destroyed = true - if (stream.destroy) stream.destroy(e) - return - } - - data = null - err = null - } - - var onresult = function () { - if (!fn) return - var tmp = fn - fn = undefined - tmp(err, data, consume) - } - - var update = function () { - if (!fn) return - data = shift(stream) - if (data === null && !ended) return - onresult() - } - - var onend = function () { - ended = true - onresult() - } - - stream.on('readable', update) - - stream.on('error', function (e) { - err = e - onresult() - }) - - stream.on('close', function () { - if (stream._readableState.ended) return - onend() - }) - - stream.on('end', onend) - - return function (callback) { - if (destroyed) return - if (err) return callback(err, null, consume) - if (data) return callback(null, data, consume) - if (ended) return callback(null, null, consume) - fn = callback - update() - } -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/.npmignore b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/.travis.yml b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/.travis.yml deleted file mode 100644 index ecd4193f60..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "6" diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/LICENSE b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/LICENSE deleted file mode 100644 index bae9da7bfa..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 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. diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/README.md b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/README.md deleted file mode 100644 index d9cc2d945f..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# stream-shift - -Returns the next buffer/object in a stream's readable queue - -``` -npm install stream-shift -``` - -[![build status](http://img.shields.io/travis/mafintosh/stream-shift.svg?style=flat)](http://travis-ci.org/mafintosh/stream-shift) - -## Usage - -``` js -var shift = require('stream-shift') - -console.log(shift(someStream)) // first item in its buffer -``` - -## Credit - -Thanks [@dignifiedquire](https://github.com/dignifiedquire) for making this work on node 6 - -## License - -MIT diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/index.js b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/index.js deleted file mode 100644 index c4b18b9c2a..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/index.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = shift - -function shift (stream) { - var rs = stream._readableState - if (!rs) return null - return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) -} - -function getStateLength (state) { - if (state.buffer.length) { - // Since node 6.3.0 state.buffer is a BufferList not an array - if (state.buffer.head) { - return state.buffer.head.data.length - } - - return state.buffer[0].length - } - - return state.length -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/package.json b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/package.json deleted file mode 100644 index 83077ba491..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "_from": "stream-shift@^1.0.0", - "_id": "stream-shift@1.0.0", - "_integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "_location": "/sorted-union-stream/stream-iterate/stream-shift", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-shift@^1.0.0", - "name": "stream-shift", - "escapedName": "stream-shift", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/sorted-union-stream/stream-iterate" - ], - "_resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "_shasum": "d5c752825e5367e786f78e18e445ea223a155952", - "_shrinkwrap": null, - "_spec": "stream-shift@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/sorted-union-stream/node_modules/stream-iterate", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bin": null, - "bugs": { - "url": "https://github.com/mafintosh/stream-shift/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Returns the next buffer/object in a stream's readable queue", - "devDependencies": { - "standard": "^7.1.2", - "tape": "^4.6.0", - "through2": "^2.0.1" - }, - "homepage": "https://github.com/mafintosh/stream-shift", - "license": "MIT", - "main": "index.js", - "name": "stream-shift", - "optionalDependencies": {}, - "peerDependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-shift.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/test.js b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/test.js deleted file mode 100644 index c0222c37d5..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/node_modules/stream-shift/test.js +++ /dev/null @@ -1,48 +0,0 @@ -var tape = require('tape') -var through = require('through2') -var stream = require('stream') -var shift = require('./') - -tape('shifts next', function (t) { - var passthrough = through() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with core', function (t) { - var passthrough = stream.PassThrough() - - passthrough.write('hello') - passthrough.write('world') - - t.same(shift(passthrough), Buffer('hello')) - t.same(shift(passthrough), Buffer('world')) - t.end() -}) - -tape('shifts next with object mode', function (t) { - var passthrough = through({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) - -tape('shifts next with object mode with core', function (t) { - var passthrough = stream.PassThrough({objectMode: true}) - - passthrough.write({hello: 1}) - passthrough.write({world: 1}) - - t.same(shift(passthrough), {hello: 1}) - t.same(shift(passthrough), {world: 1}) - t.end() -}) diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/package.json b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/package.json deleted file mode 100644 index c8f83d017b..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "stream-iterate@^1.1.0", - "_id": "stream-iterate@1.2.0", - "_integrity": "sha1-K9fHcpbBcCpGSIuK1B95hl7s1OE=", - "_location": "/sorted-union-stream/stream-iterate", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "stream-iterate@^1.1.0", - "name": "stream-iterate", - "escapedName": "stream-iterate", - "rawSpec": "^1.1.0", - "saveSpec": null, - "fetchSpec": "^1.1.0" - }, - "_requiredBy": [ - "/sorted-union-stream" - ], - "_resolved": "https://registry.npmjs.org/stream-iterate/-/stream-iterate-1.2.0.tgz", - "_shasum": "2bd7c77296c1702a46488b8ad41f79865eecd4e1", - "_shrinkwrap": null, - "_spec": "stream-iterate@^1.1.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/sorted-union-stream", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "bin": null, - "bugs": { - "url": "https://github.com/mafintosh/stream-iterate/issues" - }, - "bundleDependencies": false, - "dependencies": { - "readable-stream": "^2.1.5", - "stream-shift": "^1.0.0" - }, - "deprecated": false, - "description": "Iterate through the values of a stream", - "devDependencies": { - "from2": "^1.3.0", - "standard": "^3.3.2", - "tape": "^4.0.0" - }, - "homepage": "https://github.com/mafintosh/stream-iterate", - "license": "MIT", - "main": "index.js", - "name": "stream-iterate", - "optionalDependencies": {}, - "peerDependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/stream-iterate.git" - }, - "scripts": { - "test": "standard && tape test.js" - }, - "version": "1.2.0" -} diff --git a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/test.js b/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/test.js deleted file mode 100644 index 5beb23a5d9..0000000000 --- a/deps/npm/node_modules/sorted-union-stream/node_modules/stream-iterate/test.js +++ /dev/null @@ -1,60 +0,0 @@ -var tape = require('tape') -var from = require('from2') -var iterate = require('./') - -tape('merge sort', function (t) { - var a = from.obj(['a', 'b', 'd', 'e', 'g', 'h']) - var b = from.obj(['b', 'c', 'f']) - var output = [] - - var readA = iterate(a) - var readB = iterate(b) - - var loop = function () { - readA(function (err, dataA, nextA) { - if (err) throw err - readB(function (err, dataB, nextB) { - if (err) throw err - - if (!dataA && !dataB) { - t.same(output, ['a', 'b', 'b', 'c', 'd', 'e', 'f', 'g', 'h'], 'sorts list') - t.end() - return - } - - if (!dataB || dataA < dataB) { - output.push(dataA) - nextA() - return loop() - } - - if (!dataA || dataA > dataB) { - output.push(dataB) - nextB() - return loop() - } - - output.push(dataA) - output.push(dataB) - nextA() - nextB() - loop() - }) - }) - } - - loop() -}) - -tape('error handling', function (t) { - var a = from.obj(['a', 'b', 'd', 'e', 'g', 'h']) - var read = iterate(a) - - a.destroy(new Error('oh no')) - - read(function (err) { - t.ok(err, 'had error') - t.same(err.message, 'oh no') - t.end() - }) -}) |