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

Function getTotalBytes

out/cli.cjs:6368–6385  ·  view source on GitHub ↗
(instance)

Source from the content-addressed store, hash-verified

6366 }
6367 }
6368 function getTotalBytes(instance) {
6369 const body = instance.body;
6370 if (body === null) {
6371 return 0;
6372 } else if (isBlob4(body)) {
6373 return body.size;
6374 } else if (Buffer.isBuffer(body)) {
6375 return body.length;
6376 } else if (body && typeof body.getLengthSync === "function") {
6377 if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
6378 body.hasKnownLength && body.hasKnownLength()) {
6379 return body.getLengthSync();
6380 }
6381 return null;
6382 } else {
6383 return null;
6384 }
6385 }
6386 function writeToStream(dest, instance) {
6387 const body = instance.body;
6388 if (body === null) {

Callers 2

getNodeRequestOptionsFunction · 0.85
fetch4Function · 0.85

Calls 1

isBlob4Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…