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

Function specConsumeBody

out/cli.cjs:52399–52420  ·  view source on GitHub ↗
(object, convertBytesToJSValue, instance)

Source from the content-addressed store, hash-verified

52397 }
52398 }
52399 };
52400 return methods;
52401 }
52402 function mixinBody(prototype3) {
52403 Object.assign(prototype3.prototype, bodyMixinMethods(prototype3));
52404 }
52405 async function specConsumeBody(object, convertBytesToJSValue, instance) {
52406 webidl.brandCheck(object, instance);
52407 throwIfAborted(object[kState]);
52408 if (bodyUnusable(object[kState].body)) {
52409 throw new TypeError("Body is unusable");
52410 }
52411 const promise = createDeferredPromise();
52412 const errorSteps = (error) => promise.reject(error);
52413 const successSteps = (data) => {
52414 try {
52415 promise.resolve(convertBytesToJSValue(data));
52416 } catch (e3) {
52417 errorSteps(e3);
52418 }
52419 };
52420 if (object[kState].body == null) {
52421 successSteps(new Uint8Array());
52422 return promise.promise;
52423 }

Callers 4

blobFunction · 0.85
arrayBufferFunction · 0.85
textFunction · 0.85
jsonFunction · 0.85

Calls 5

throwIfAbortedFunction · 0.85
bodyUnusableFunction · 0.85
createDeferredPromiseFunction · 0.85
successStepsFunction · 0.85
fullyReadBodyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…