|
|
|
@ -12,7 +12,7 @@ const isFunction = require("@validatem/is-function");
|
|
|
|
|
const defaultTo = require("@validatem/default-to");
|
|
|
|
|
|
|
|
|
|
// FIXME: Update other stream implementations to new API
|
|
|
|
|
module.exports = function greedySinkStream(_options) {
|
|
|
|
|
module.exports = function simpleSinkStream(_options) {
|
|
|
|
|
let { onResult, onEnd, onAbort } = validateOptions(arguments, {
|
|
|
|
|
onResult: [ required, isFunction ],
|
|
|
|
|
onEnd: [ isFunction, defaultTo.literal(defaultOnEnd) ],
|
|
|
|
@ -34,10 +34,10 @@ module.exports = function greedySinkStream(_options) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
description: `greedy sink stream`,
|
|
|
|
|
description: `simple sink stream`,
|
|
|
|
|
abort: propagateAbort,
|
|
|
|
|
peek: propagatePeek,
|
|
|
|
|
read: function produceValue_greedySinkStream(source) {
|
|
|
|
|
read: function produceValue_simpleSinkStream(source) {
|
|
|
|
|
function attemptRead() {
|
|
|
|
|
return Promise.try(() => {
|
|
|
|
|
return source.read();
|
|
|
|
|