Comparing version 2.0.1 to 2.0.2
@@ -26,10 +26,7 @@ 'use strict'; | ||
var error, finish, end, open, | ||
readError, writeError, | ||
streams = allStreams.slice(), | ||
read = streams.shift(), | ||
write = streams.pop(), | ||
isFsRead = read instanceof fs.ReadStream, | ||
isFsWrite = write instanceof fs.WriteStream, | ||
readError, writeError; | ||
var streams = allStreams.slice(); | ||
var read = streams.shift(); | ||
var write = streams.pop(), | ||
isGunzip = allStreams.some(function (write) { | ||
@@ -68,11 +65,10 @@ return write instanceof zlib.Gunzip | ||
if (end && readError) { | ||
onEnd(); | ||
} else { | ||
open = true; | ||
write.on('error', onWriteError); | ||
setListeners(streams, onError); | ||
fullPipe(allStreams, options); | ||
} | ||
if (end && readError) | ||
{ return onEnd(); } | ||
open = true; | ||
write.on('error', onWriteError); | ||
setListeners(streams, onError); | ||
fullPipe(allStreams, options); | ||
}); | ||
@@ -86,3 +82,3 @@ | ||
} | ||
function onReadError(error) { | ||
@@ -108,2 +104,4 @@ readError = true; | ||
destroy(finish, write); | ||
if (!end && !finish) | ||
@@ -170,7 +168,7 @@ { onResult(); } | ||
if (!main) | ||
{ main = stream; } | ||
else | ||
{ main = main.pipe(stream, { | ||
end: options.end | ||
}); } | ||
{ return main = stream; } | ||
main = main.pipe(stream, { | ||
end: options.end | ||
}); | ||
}); | ||
@@ -185,2 +183,9 @@ } | ||
function destroy(finish, stream) { | ||
if (!finish || !stream.destroy) | ||
{ return; } | ||
stream.destroy(); | ||
} | ||
function unsetListeners(streams, fn) { | ||
@@ -187,0 +192,0 @@ streams.forEach(function (stream) { |
@@ -26,10 +26,7 @@ 'use strict'; | ||
let error, finish, end, open, | ||
readError, writeError, | ||
streams = allStreams.slice(), | ||
read = streams.shift(), | ||
write = streams.pop(), | ||
isFsRead = read instanceof fs.ReadStream, | ||
isFsWrite = write instanceof fs.WriteStream, | ||
readError, writeError; | ||
const streams = allStreams.slice(); | ||
const read = streams.shift(); | ||
const write = streams.pop(), | ||
isGunzip = allStreams.some((write) => { | ||
@@ -68,11 +65,10 @@ return write instanceof zlib.Gunzip | ||
if (end && readError) { | ||
onEnd(); | ||
} else { | ||
open = true; | ||
write.on('error', onWriteError); | ||
setListeners(streams, onError); | ||
fullPipe(allStreams, options); | ||
} | ||
if (end && readError) | ||
return onEnd(); | ||
open = true; | ||
write.on('error', onWriteError); | ||
setListeners(streams, onError); | ||
fullPipe(allStreams, options); | ||
}); | ||
@@ -86,3 +82,3 @@ | ||
} | ||
function onReadError(error) { | ||
@@ -108,2 +104,4 @@ readError = true; | ||
destroy(finish, write); | ||
if (!end && !finish) | ||
@@ -170,7 +168,7 @@ onResult(); | ||
if (!main) | ||
main = stream; | ||
else | ||
main = main.pipe(stream, { | ||
end: options.end | ||
}); | ||
return main = stream; | ||
main = main.pipe(stream, { | ||
end: options.end | ||
}); | ||
}); | ||
@@ -185,2 +183,9 @@ } | ||
function destroy(finish, stream) { | ||
if (!finish || !stream.destroy) | ||
return; | ||
stream.destroy(); | ||
} | ||
function unsetListeners(streams, fn) { | ||
@@ -187,0 +192,0 @@ streams.forEach((stream) => { |
{ | ||
"name": "pipe-io", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -36,7 +36,7 @@ "description": "Pipe streams and handle events", | ||
"devDependencies": { | ||
"buble": "^0.14.2", | ||
"buble": "^0.15.1", | ||
"coveralls": "^2.11.6", | ||
"eslint": "^3.8.1", | ||
"nodemon": "^1.11.0", | ||
"nyc": "^8.3.2", | ||
"nyc": "^10.0.0", | ||
"pullout": "^1.0.1", | ||
@@ -43,0 +43,0 @@ "redrun": "^5.9.2", |
@@ -32,3 +32,3 @@ Pipe-io [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
In old `node.js` environments that not fully supports `es2015`, `pullout` could be used with: | ||
In old `node.js` environments that not fully supports `es2015`, `pipe` could be used with: | ||
@@ -35,0 +35,0 @@ ```js |
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
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
16936
303