Version 1
[yaffs-website] / node_modules / concat-stream / node_modules / readable-stream / lib / _stream_passthrough.js
1 // a passthrough stream.
2 // basically just the most minimal sort of Transform stream.
3 // Every written chunk gets output as-is.
4
5 'use strict';
6
7 module.exports = PassThrough;
8
9 var Transform = require('./_stream_transform');
10
11 /*<replacement>*/
12 var util = require('core-util-is');
13 util.inherits = require('inherits');
14 /*</replacement>*/
15
16 util.inherits(PassThrough, Transform);
17
18 function PassThrough(options) {
19   if (!(this instanceof PassThrough)) return new PassThrough(options);
20
21   Transform.call(this, options);
22 }
23
24 PassThrough.prototype._transform = function (chunk, encoding, cb) {
25   cb(null, chunk);
26 };