withParser.js 289 B

12345678910
  1. 'use strict';
  2. const {chain} = require('stream-chain');
  3. const Parser = require('../Parser');
  4. const withParser = (fn, options) =>
  5. chain([new Parser(options), fn(options)], Object.assign({}, options, {writableObjectMode: false, readableObjectMode: true}));
  6. module.exports = withParser;