Comparing version 1.1.18 to 1.1.19
(function () { | ||
'use strict'; | ||
var assert = require('assert'); | ||
var fs = require('fs'), | ||
assert = require('assert'); | ||
@@ -37,3 +38,5 @@ module.exports = all; | ||
setListeners(streams, options, onError); | ||
callWhenOpen(write, function() { | ||
setListeners(streams, options, onError); | ||
}); | ||
@@ -71,2 +74,17 @@ read.on('error', onResultError); | ||
} | ||
/* | ||
* when stream is fs.WriteStream | ||
* finish event could be emitted before | ||
* open and then everything crash | ||
*/ | ||
function callWhenOpen(stream, fn) { | ||
var isFsWrite = stream instanceof fs.WriteStream; | ||
if (!isFsWrite) | ||
fn(); | ||
else | ||
stream.on('open', function() { | ||
fn(); | ||
}); | ||
} | ||
@@ -73,0 +91,0 @@ function setListeners(streams, options, fn) { |
{ | ||
"name": "pipe-io", | ||
"version": "1.1.18", | ||
"version": "1.1.19", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -5,0 +5,0 @@ "description": "Pipe streams and handle events", |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
7641
111
1