MCPcopy Create free account
hub / github.com/ReactJSResources/react-webpack-babel / encodeBlob

Function encodeBlob

public/bundle.js:4976–4990  ·  view source on GitHub ↗
(packet, supportsBinary, callback)

Source from the content-addressed store, hash-verified

4974 }
4975
4976 function encodeBlob(packet, supportsBinary, callback) {
4977 if (!supportsBinary) {
4978 return exports.encodeBase64Packet(packet, callback);
4979 }
4980
4981 if (dontSendBlobs) {
4982 return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
4983 }
4984
4985 var length = new Uint8Array(1);
4986 length[0] = packets[packet.type];
4987 var blob = new Blob([length.buffer, packet.data]);
4988
4989 return callback(blob);
4990 }
4991
4992 /**
4993 * Encodes a packet with binary data in a base64 string

Callers 1

bundle.jsFile · 0.85

Calls 2

encodeBlobAsArrayBufferFunction · 0.85
callbackFunction · 0.85

Tested by

no test coverage detected