MCPcopy Create free account
hub / github.com/nodejs/node / blob

Function blob

deps/undici/undici.js:6851–6861  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6849 function bodyMixinMethods(instance, getInternalState) {
6850 const methods = {
6851 blob() {
6852 return consumeBody(this, (bytes) => {
6853 let mimeType = bodyMimeType(getInternalState(this));
6854 if (mimeType === null) {
6855 mimeType = "";
6856 } else if (mimeType) {
6857 mimeType = serializeAMimeType(mimeType);
6858 }
6859 return new Blob([bytes], { type: mimeType });
6860 }, instance, getInternalState);
6861 },
6862 arrayBuffer() {
6863 return consumeBody(this, (bytes) => {
6864 return new Uint8Array(bytes).buffer;

Callers 1

Calls 3

consumeBodyFunction · 0.70
bodyMimeTypeFunction · 0.70
serializeAMimeTypeFunction · 0.70

Tested by

no test coverage detected