MCPcopy
hub / github.com/di-sukharev/opencommit / dump

Method dump

out/cli.cjs:56144–56178  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

56142 this[kBody] = ReadableStreamFrom(this);
56143 if (this[kConsume]) {
56144 this[kBody].getReader();
56145 assert2(this[kBody].locked);
56146 }
56147 }
56148 return this[kBody];
56149 }
56150 dump(opts) {
56151 let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144;
56152 const signal = opts && opts.signal;
56153 if (signal) {
56154 try {
56155 if (typeof signal !== "object" || !("aborted" in signal)) {
56156 throw new InvalidArgumentError("signal must be an AbortSignal");
56157 }
56158 util4.throwIfAborted(signal);
56159 } catch (err) {
56160 return Promise.reject(err);
56161 }
56162 }
56163 if (this.closed) {
56164 return Promise.resolve(null);
56165 }
56166 return new Promise((resolve, reject) => {
56167 const signalListenerCleanup = signal ? util4.addAbortListener(signal, () => {
56168 this.destroy();
56169 }) : noop2;
56170 this.on("close", function() {
56171 signalListenerCleanup();
56172 if (signal && signal.aborted) {
56173 reject(signal.reason || Object.assign(new Error("The operation was aborted"), { name: "AbortError" }));
56174 } else {
56175 resolve(null);
56176 }
56177 }).on("error", noop2).on("data", function(chunk) {
56178 limit -= chunk.length;
56179 if (limit <= 0) {
56180 this.destroy();
56181 }

Callers

nothing calls this directly

Calls 6

destroyMethod · 0.95
onMethod · 0.95
rejectFunction · 0.85
isFiniteMethod · 0.80
resumeMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected