MCPcopy
hub / github.com/di-sukharev/opencommit / "node_modules/combined-stream/lib/combined_stream.js"

Function "node_modules/combined-stream/lib/combined_stream.js"

out/cli.cjs:15581–15745  ·  view source on GitHub ↗
(exports2, module2)

Source from the content-addressed store, hash-verified

15579// node_modules/combined-stream/lib/combined_stream.js
15580var require_combined_stream = __commonJS({
15581 "node_modules/combined-stream/lib/combined_stream.js"(exports2, module2) {
15582 var util4 = require("util");
15583 var Stream3 = require("stream").Stream;
15584 var DelayedStream = require_delayed_stream();
15585 module2.exports = CombinedStream;
15586 function CombinedStream() {
15587 this.writable = false;
15588 this.readable = true;
15589 this.dataSize = 0;
15590 this.maxDataSize = 2 * 1024 * 1024;
15591 this.pauseStreams = true;
15592 this._released = false;
15593 this._streams = [];
15594 this._currentStream = null;
15595 this._insideLoop = false;
15596 this._pendingNext = false;
15597 }
15598 util4.inherits(CombinedStream, Stream3);
15599 CombinedStream.create = function(options) {
15600 var combinedStream = new this();
15601 options = options || {};
15602 for (var option in options) {
15603 combinedStream[option] = options[option];
15604 }
15605 return combinedStream;
15606 };
15607 CombinedStream.isStreamLike = function(stream4) {
15608 return typeof stream4 !== "function" && typeof stream4 !== "string" && typeof stream4 !== "boolean" && typeof stream4 !== "number" && !Buffer.isBuffer(stream4);
15609 };
15610 CombinedStream.prototype.append = function(stream4) {
15611 var isStreamLike = CombinedStream.isStreamLike(stream4);
15612 if (isStreamLike) {
15613 if (!(stream4 instanceof DelayedStream)) {
15614 var newStream = DelayedStream.create(stream4, {
15615 maxDataSize: Infinity,
15616 pauseStream: this.pauseStreams
15617 });
15618 stream4.on("data", this._checkDataSize.bind(this));
15619 stream4 = newStream;
15620 }
15621 this._handleErrors(stream4);
15622 if (this.pauseStreams) {
15623 stream4.pause();
15624 }
15625 }
15626 this._streams.push(stream4);
15627 return this;
15628 };
15629 CombinedStream.prototype.pipe = function(dest, options) {
15630 Stream3.prototype.pipe.call(this, dest, options);
15631 this.resume();
15632 return dest;
15633 };
15634 CombinedStream.prototype._getNext = function() {
15635 this._currentStream = null;
15636 if (this._insideLoop) {
15637 this._pendingNext = true;
15638 return;

Callers

nothing calls this directly

Calls 11

getStream3Function · 0.85
resumeMethod · 0.80
endMethod · 0.80
pipeMethod · 0.80
createMethod · 0.45
onMethod · 0.45
pushMethod · 0.45
shiftMethod · 0.45
writeMethod · 0.45
emitMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…