diff --git a/index.js b/index.js index 4a97475..9425e24 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ const debug = require("debug")("promistream:last-will"); const isEndOfStream = require("@promistream/is-end-of-stream"); const isAborted = require("@promistream/is-aborted"); +const propagateAbort = require("@promistream/propagate-abort"); const { validateOptions } = require("@validatem/core"); const isFunction = require("@validatem/is-function"); @@ -79,10 +80,7 @@ module.exports = function lastWill() { return { _promistreamVersion: 0, description: `last-will handler`, - abort: function abort_lastWill(source, reason) { - // FIXME: propagate module - return source.abort(reason); - }, + abort: propagateAbort, peek: function peek_lastWill(source) { return Promise.try(() => { return pauser.await(); diff --git a/package.json b/package.json index 383c4a3..3aa1a63 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@joepie91/consumable": "^1.0.1", "@promistream/is-aborted": "^0.1.0", "@promistream/is-end-of-stream": "^0.1.0", + "@promistream/propagate-abort": "^0.1.6", "@validatem/core": "^0.3.15", "@validatem/is-function": "^0.1.0", "@validatem/require-either": "^0.1.0", diff --git a/yarn.lock b/yarn.lock index 1f72ab1..6540522 100644 --- a/yarn.lock +++ b/yarn.lock @@ -58,6 +58,11 @@ resolved "https://registry.yarnpkg.com/@promistream/is-end-of-stream/-/is-end-of-stream-0.1.1.tgz#7f84e630c9e49a92739df6a8c574eff99dd4c09d" integrity sha512-GZn7W0wrUen7kkgWCcwFFgr0g/ftfuddnuK/Tp0MLWCCJA4hyAboglCZP0JzEJdi34gClEP8lCfDwGekw18LHg== +"@promistream/propagate-abort@^0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@promistream/propagate-abort/-/propagate-abort-0.1.6.tgz#dfc3c78c2e22662b9e5d548afce2180c40584ef5" + integrity sha512-Ap4eDFiIcLb4yuJdin2tQM1+2ZJZm78sYWkKVdqECJY0UGkwNsbaMMeYyfZpFRpJGmW8mCCuOkWs0fQl5H9DGA== + "@validatem/allow-extra-properties@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@validatem/allow-extra-properties/-/allow-extra-properties-0.1.0.tgz#e8c434818d6fd74b8cb237cfaa4d548295de13c1"