MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / extractContentType

Function extractContentType

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

Source from the content-addressed store, hash-verified

6343 return body;
6344 }
6345 function extractContentType(body) {
6346 if (body === null) {
6347 return null;
6348 } else if (typeof body === "string") {
6349 return "text/plain;charset=UTF-8";
6350 } else if (isURLSearchParams2(body)) {
6351 return "application/x-www-form-urlencoded;charset=UTF-8";
6352 } else if (isBlob4(body)) {
6353 return body.type || null;
6354 } else if (Buffer.isBuffer(body)) {
6355 return null;
6356 } else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") {
6357 return null;
6358 } else if (ArrayBuffer.isView(body)) {
6359 return null;
6360 } else if (typeof body.getBoundary === "function") {
6361 return `multipart/form-data;boundary=${body.getBoundary()}`;
6362 } else if (body instanceof Stream3) {
6363 return null;
6364 } else {
6365 return "text/plain;charset=UTF-8";
6366 }
6367 }
6368 function getTotalBytes(instance) {
6369 const body = instance.body;
6370 if (body === null) {

Callers 2

constructorMethod · 0.85
constructorMethod · 0.85

Calls 2

isURLSearchParams2Function · 0.85
isBlob4Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…