Files
shadowsocks-over-websocket/node_modules/readable-stream/lib/_stream_passthrough.js

26 lines
604 B
JavaScript
Raw Normal View History

2017-04-06 09:21:19 +08:00
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
2017-04-06 10:44:45 +08:00
'use strict';
2017-04-06 09:21:19 +08:00
module.exports = PassThrough;
var Transform = require('./_stream_transform');
/*<replacement>*/
var util = require('core-util-is');
util.inherits = require('inherits');
/*</replacement>*/
util.inherits(PassThrough, Transform);
function PassThrough(options) {
2017-04-06 10:44:45 +08:00
if (!(this instanceof PassThrough)) return new PassThrough(options);
2017-04-06 09:21:19 +08:00
Transform.call(this, options);
}
2017-04-06 10:44:45 +08:00
PassThrough.prototype._transform = function (chunk, encoding, cb) {
2017-04-06 09:21:19 +08:00
cb(null, chunk);
2017-04-06 10:44:45 +08:00
};