55 lines
1.5 KiB
JavaScript
55 lines
1.5 KiB
JavaScript
// Metro module 1132 (f1133).
|
|
import { encodeUTF8 } from "./Module1004";
|
|
export function parseContentLengthHeader(a0) {
|
|
if (a0) {
|
|
const r5 = parseInt(a0, 10);
|
|
return isNaN(r5) ? void 0 : r5;
|
|
}
|
|
}
|
|
export function getBodySize(a0) {
|
|
let byteLength, length, length2, length3, size;
|
|
L18: {
|
|
if (a0) {
|
|
L16: {
|
|
L14: {
|
|
L12: {
|
|
L10: {
|
|
try {
|
|
if (typeof a0 === "string") {
|
|
length3 = encodeUTF8(a0).length;
|
|
break L16;
|
|
}
|
|
if (a0 instanceof URLSearchParams) {
|
|
length2 = encodeUTF8(a0.toString()).length;
|
|
break L14;
|
|
}
|
|
if (a0 instanceof FormData) {
|
|
length = encodeUTF8((function _serializeFormData(a0) {
|
|
return new URLSearchParams(a0).toString();
|
|
})(a0)).length;
|
|
break L12;
|
|
}
|
|
if (a0 instanceof Blob) {
|
|
size = a0.size;
|
|
break L10;
|
|
}
|
|
if (!(a0 instanceof ArrayBuffer)) {
|
|
break L18;
|
|
}
|
|
byteLength = a0.byteLength;
|
|
} catch ($e) {
|
|
break L18;
|
|
}
|
|
return byteLength;
|
|
}
|
|
return size;
|
|
}
|
|
return length;
|
|
}
|
|
return length2;
|
|
}
|
|
return length3;
|
|
}
|
|
}
|
|
}
|