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

Function clone

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

Source from the content-addressed store, hash-verified

6327 return typeof obj === "object" && typeof obj.arrayBuffer === "function" && typeof obj.type === "string" && typeof obj.stream === "function" && typeof obj.constructor === "function" && typeof obj.constructor.name === "string" && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
6328 }
6329 function clone(instance) {
6330 let p1, p22;
6331 let body = instance.body;
6332 if (instance.bodyUsed) {
6333 throw new Error("cannot clone body after it is used");
6334 }
6335 if (body instanceof Stream3 && typeof body.getBoundary !== "function") {
6336 p1 = new PassThrough();
6337 p22 = new PassThrough();
6338 body.pipe(p1);
6339 body.pipe(p22);
6340 instance[INTERNALS].body = p1;
6341 body = p22;
6342 }
6343 return body;
6344 }
6345 function extractContentType(body) {
6346 if (body === null) {
6347 return null;

Callers 2

cloneMethod · 0.85
constructorMethod · 0.85

Calls 1

pipeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…