From d5b50a9383b8f6ce4a3db9b6c22db82bfb00f3e5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 31 Oct 2014 11:34:07 -0400 Subject: [PATCH] feature(pipe) rm Util.exec --- lib/server/pipe.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/server/pipe.js b/lib/server/pipe.js index 469c8f11..be5471da 100644 --- a/lib/server/pipe.js +++ b/lib/server/pipe.js @@ -25,7 +25,7 @@ * @param callback - function(error) {} */ function create(read, write, options, callback) { - var gzip, isFsWrite, func, + var gzip, isFsWrite, isStrRead = type.string(read), isStrWrite = type.string(write), isFunc = type.function(options), @@ -34,15 +34,13 @@ bufferSize: 4 * 1024 }; - Util.checkArgs(arguments, ['read', 'write', 'options']); + Util.checkArgs(arguments, ['read', 'write', 'callback']); if (isFunc) callback = options; else o = options; - func = Util.exec.ret(callback); - if (options.range) Util.extend(optionsRead, { start : o.range.start, @@ -64,19 +62,19 @@ else gzip = zlib.createGunzip(); - on('error', read, func); + on('error', read, callback); read = read.pipe(gzip); } - on('error', write, func); - on('error', read, func); + on('error', write, callback); + on('error', read, callback); Util.exec.if(!isFsWrite, function() { read.pipe(write, { end: !o.notEnd }); - on('end', read, func); + on('end', read, callback); }, function(callback) { on('open', write, callback); });