UNPKG

stream-chain

Version:

Chain functions, generators, Node streams, and Web streams into a pipeline with backpressure support.

18 lines (14 loc) 564 B
// @ts-self-types="./parserWebStream.d.ts" import asWebStream from '../asWebStream.js'; import parser from './parser.js'; const parserWebStream = options => { const reviver = options?.reviver, ignoreErrors = options?.ignoreErrors, hasErrorIndicator = !!options && 'errorIndicator' in options, parserOptions = hasErrorIndicator ? {reviver, ignoreErrors, errorIndicator: options.errorIndicator} : {reviver, ignoreErrors}; return asWebStream(parser(parserOptions), options); }; export default parserWebStream; export {parserWebStream};