|
|
@ -7,6 +7,7 @@ const debug = require("debug")("promistream:last-will");
|
|
|
|
|
|
|
|
|
|
|
|
const isEndOfStream = require("@promistream/is-end-of-stream");
|
|
|
|
const isEndOfStream = require("@promistream/is-end-of-stream");
|
|
|
|
const isAborted = require("@promistream/is-aborted");
|
|
|
|
const isAborted = require("@promistream/is-aborted");
|
|
|
|
|
|
|
|
const propagateAbort = require("@promistream/propagate-abort");
|
|
|
|
|
|
|
|
|
|
|
|
const { validateOptions } = require("@validatem/core");
|
|
|
|
const { validateOptions } = require("@validatem/core");
|
|
|
|
const isFunction = require("@validatem/is-function");
|
|
|
|
const isFunction = require("@validatem/is-function");
|
|
|
@ -79,10 +80,7 @@ module.exports = function lastWill() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
_promistreamVersion: 0,
|
|
|
|
_promistreamVersion: 0,
|
|
|
|
description: `last-will handler`,
|
|
|
|
description: `last-will handler`,
|
|
|
|
abort: function abort_lastWill(source, reason) {
|
|
|
|
abort: propagateAbort,
|
|
|
|
// FIXME: propagate module
|
|
|
|
|
|
|
|
return source.abort(reason);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
peek: function peek_lastWill(source) {
|
|
|
|
peek: function peek_lastWill(source) {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return Promise.try(() => {
|
|
|
|
return pauser.await();
|
|
|
|
return pauser.await();
|
|
|
|