passthrough.js 371 B

123456789101112131415
  1. import {Transform} from './transform';
  2. import {inherits} from 'util';
  3. inherits(PassThrough, Transform);
  4. export default PassThrough;
  5. export function PassThrough(options) {
  6. if (!(this instanceof PassThrough)) return new PassThrough(options);
  7. Transform.call(this, options);
  8. }
  9. PassThrough.prototype._transform = function (chunk, encoding, cb) {
  10. cb(null, chunk);
  11. };