From 6d67e79891649e07f9b36f7f951e6da30404f79a Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 22 Jun 2021 15:55:49 +0200 Subject: [PATCH] Fix abort argument order --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 299293a..8169f23 100644 --- a/index.js +++ b/index.js @@ -58,7 +58,7 @@ module.exports = function pipe(_streams) { if (bound != null) { return Object.assign({}, stream, { read: stream.read.bind(null, bound), - abort: stream.abort.bind(null, bound), + abort: (reason) => stream.abort(reason, bound), // bindRight equivalent peek: stream.peek.bind(null, bound) }); } else { @@ -97,7 +97,7 @@ module.exports = function pipe(_streams) { return getPipeline(source).peek(); } }, - abort: function (source, reason) { + abort: function (reason, source) { if(!verifyFullPipeline(source)) { throw new Error("Cannot abort a partial pipeline; maybe you forgot to specify a source stream?"); } else {