Browse Source

Remove unnecessary function call

master
Sven Slootweg 6 months ago
parent
commit
537b132ae8
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      index.js

+ 4
- 4
index.js View File

@@ -18,12 +18,10 @@ module.exports = function simpleSinkStream(_options) {
required,
wrapValueAsOption("onResult"), {
onResult: [ required, isFunction ],
onAbort: [ isFunction ],
onEnd: [ isFunction, defaultTo.literal(function defaultOnEnd() {
// We return whatever value we got last from the specified onResult callback.
return lastResult;
})],
onAbort: [ isFunction, defaultTo.literal(function defaultOnAbort() {
// no-op
})]
}
]);
@@ -88,7 +86,9 @@ module.exports = function simpleSinkStream(_options) {
abortHandled = true;

return Promise.try(() => {
return onAbort();
if (onAbort != null) {
return onAbort();
}
}).then(() => {
if (marker.reason instanceof Error) {
// NOTE: This ensures that the original error causing the abort is thrown exactly once


Loading…
Cancel
Save