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

Function bodyLength

out/cli.cjs:47871–47883  ·  view source on GitHub ↗
(body)

Source from the content-addressed store, hash-verified

47869 return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function"));
47870 }
47871 function bodyLength(body) {
47872 if (body == null) {
47873 return 0;
47874 } else if (isStream3(body)) {
47875 const state2 = body._readableState;
47876 return state2 && state2.objectMode === false && state2.ended === true && Number.isFinite(state2.length) ? state2.length : null;
47877 } else if (isBlobLike3(body)) {
47878 return body.size != null ? body.size : null;
47879 } else if (isBuffer2(body)) {
47880 return body.byteLength;
47881 }
47882 return null;
47883 }
47884 function isDestroyed(stream5) {
47885 return !stream5 || !!(stream5.destroyed || stream5[kDestroyed]);
47886 }

Callers

nothing calls this directly

Calls 4

isStream3Function · 0.85
isBlobLike3Function · 0.85
isBuffer2Function · 0.85
isFiniteMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…