Files
discord-decomp/_bundle/checkBoxedPrimitive.js
T
2026-11-01 12:12:55 +02:00

244 lines
9.2 KiB
JavaScript

// Metro module 1391 (f1392).
import * as _isArguments from "./isArguments";
import * as _isGeneratorFunction from "./isGeneratorFunction";
import * as _isTypedArray from "./isTypedArray";
import * as _whichTypedArray from "./whichTypedArray";
let c1152_3, c1152_4, c1152_5, c1152_6, c1152_7, c1152_8, c1152_9, c1152_10, isMapToString, isSetToString, isWeakMapToString, isArrayBufferToString, isDataViewToString, SharedArrayBuffer2, isSharedArrayBufferToString;
const checkBoxedPrimitive = function checkBoxedPrimitive(a0, a1) {
if (typeof a0 !== "object") {
return false;
}
try {
a1(a0);
} catch ($e) {
return false;
}
return true;
};
isMapToString = function isMapToString(a0) {
return c1152_5(a0) === "[object Map]";
};
isSetToString = function isSetToString(a0) {
return c1152_5(a0) === "[object Set]";
};
isWeakMapToString = function isWeakMapToString(a0) {
return c1152_5(a0) === "[object WeakMap]";
};
isArrayBufferToString = function isArrayBufferToString(a0) {
return c1152_5(a0) === "[object ArrayBuffer]";
};
isDataViewToString = function isDataViewToString(a0) {
return c1152_5(a0) === "[object DataView]";
};
isSharedArrayBufferToString = function isSharedArrayBufferToString(a0) {
return c1152_5(a0) === "[object SharedArrayBuffer]";
};
const BigInt2 = globalThis.BigInt;
c1152_3 = typeof BigInt2 !== "undefined";
const Symbol2 = globalThis.Symbol;
c1152_4 = typeof Symbol2 !== "undefined";
const toString = Object.prototype.toString;
c1152_5 = toString.call.bind(toString);
const valueOf = Number.prototype.valueOf;
c1152_6 = valueOf.call.bind(valueOf);
const valueOf2 = String.prototype.valueOf;
c1152_7 = valueOf2.call.bind(valueOf2);
const valueOf3 = Boolean.prototype.valueOf;
c1152_8 = valueOf3.call.bind(valueOf3);
if (typeof BigInt2 !== "undefined") {
const valueOf4 = BigInt.prototype.valueOf;
c1152_9 = valueOf4.call.bind(valueOf4);
}
if (typeof Symbol2 !== "undefined") {
const valueOf5 = Symbol.prototype.valueOf;
c1152_10 = valueOf5.call.bind(valueOf5);
}
export { _isArguments as isArgumentsObject };
exports.isGeneratorFunction = _isGeneratorFunction;
exports.isTypedArray = _isTypedArray;
export function isPromise(a0) {
const Promise2 = globalThis.Promise;
return (typeof Promise2 !== "undefined" ? a0 instanceof Promise : typeof Promise2 !== "undefined") || a0 !== null && typeof a0 === "object" && typeof a0.then === "function" && typeof a0.catch === "function";
}
export function isArrayBufferView(a0) {
let r13;
if (typeof globalThis.ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
r13 = ArrayBuffer.isView(a0);
} else {
r13 = _isTypedArray(a0);
if (!r13) {
const DataView2 = globalThis.DataView;
r13 = typeof DataView2 !== "undefined" ? isDataViewToString.working ? c1152_5(a0) === "[object DataView]" : a0 instanceof DataView : typeof DataView2 !== "undefined";
}
}
return r13;
}
export function isUint8Array(a0) {
return _whichTypedArray(a0) === "Uint8Array";
}
export function isUint8ClampedArray(a0) {
return _whichTypedArray(a0) === "Uint8ClampedArray";
}
export function isUint16Array(a0) {
return _whichTypedArray(a0) === "Uint16Array";
}
export function isUint32Array(a0) {
return _whichTypedArray(a0) === "Uint32Array";
}
export function isInt8Array(a0) {
return _whichTypedArray(a0) === "Int8Array";
}
export function isInt16Array(a0) {
return _whichTypedArray(a0) === "Int16Array";
}
export function isInt32Array(a0) {
return _whichTypedArray(a0) === "Int32Array";
}
export function isFloat32Array(a0) {
return _whichTypedArray(a0) === "Float32Array";
}
export function isFloat64Array(a0) {
return _whichTypedArray(a0) === "Float64Array";
}
export function isBigInt64Array(a0) {
return _whichTypedArray(a0) === "BigInt64Array";
}
export function isBigUint64Array(a0) {
return _whichTypedArray(a0) === "BigUint64Array";
}
const Map2 = globalThis.Map;
isMapToString.working = typeof Map2 !== "undefined" ? c1152_5(new Map()) === "[object Map]" : typeof Map2 !== "undefined";
export function isMap(a0) {
const Map2 = globalThis.Map;
return typeof Map2 !== "undefined" ? isMapToString.working ? c1152_5(a0) === "[object Map]" : a0 instanceof Map : typeof Map2 !== "undefined";
}
const Set2 = globalThis.Set;
isSetToString.working = typeof Set2 !== "undefined" ? c1152_5(new Set()) === "[object Set]" : typeof Set2 !== "undefined";
export function isSet(a0) {
const Set2 = globalThis.Set;
return typeof Set2 !== "undefined" ? isSetToString.working ? c1152_5(a0) === "[object Set]" : a0 instanceof Set : typeof Set2 !== "undefined";
}
const WeakMap2 = globalThis.WeakMap;
isWeakMapToString.working = typeof WeakMap2 !== "undefined" ? c1152_5(new WeakMap()) === "[object WeakMap]" : typeof WeakMap2 !== "undefined";
export function isWeakMap(a0) {
const WeakMap2 = globalThis.WeakMap;
return typeof WeakMap2 !== "undefined" ? isWeakMapToString.working ? c1152_5(a0) === "[object WeakMap]" : a0 instanceof WeakMap : typeof WeakMap2 !== "undefined";
}
const WeakSet2 = globalThis.WeakSet;
(function isWeakSetToString(a0) {
return c1152_5(a0) === "[object WeakSet]";
}).working = typeof WeakSet2 !== "undefined" ? c1152_5(new WeakSet()) === "[object WeakSet]" : typeof WeakSet2 !== "undefined";
export function isWeakSet(a0) {
return c1152_5(a0) === "[object WeakSet]";
}
const ArrayBuffer2 = globalThis.ArrayBuffer;
const working = typeof ArrayBuffer2 !== "undefined" ? c1152_5(new ArrayBuffer()) === "[object ArrayBuffer]" : typeof ArrayBuffer2 !== "undefined";
export function isArrayBuffer(a0) {
const ArrayBuffer2 = globalThis.ArrayBuffer;
return typeof ArrayBuffer2 !== "undefined" ? isArrayBufferToString.working ? c1152_5(a0) === "[object ArrayBuffer]" : a0 instanceof ArrayBuffer : typeof ArrayBuffer2 !== "undefined";
}
isArrayBufferToString.working = working;
const ArrayBuffer3 = globalThis.ArrayBuffer;
const working2 = (typeof ArrayBuffer3 !== "undefined" ? typeof globalThis.DataView !== "undefined" : typeof ArrayBuffer3 !== "undefined") && c1152_5(new DataView(new ArrayBuffer(1), 0, 1)) === "[object DataView]";
export function isDataView(a0) {
const DataView2 = globalThis.DataView;
return typeof DataView2 !== "undefined" ? isDataViewToString.working ? c1152_5(a0) === "[object DataView]" : a0 instanceof DataView : typeof DataView2 !== "undefined";
}
isDataViewToString.working = working2;
const r146 = typeof globalThis.SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0;
export function isSharedArrayBuffer(a0) {
let r1 = SharedArrayBuffer2 !== void 0;
if (r1) {
if (isSharedArrayBufferToString.working === void 0) {
isSharedArrayBufferToString.working = c1152_5(new SharedArrayBuffer2()) === "[object SharedArrayBuffer]";
}
r1 = isSharedArrayBufferToString.working ? c1152_5(a0) === "[object SharedArrayBuffer]" : a0 instanceof SharedArrayBuffer2;
}
return r1;
}
export function isNumberObject(a0) {
return checkBoxedPrimitive(a0, c1152_6);
}
export function isStringObject(a0) {
return checkBoxedPrimitive(a0, c1152_7);
}
export function isBooleanObject(a0) {
return checkBoxedPrimitive(a0, c1152_8);
}
export function isBigIntObject(a0) {
let r1 = c1152_3;
if (c1152_3) {
r1 = checkBoxedPrimitive(a0, c1152_9);
}
return r1;
}
export function isSymbolObject(a0) {
let r1 = c1152_4;
if (c1152_4) {
r1 = checkBoxedPrimitive(a0, c1152_10);
}
return r1;
}
SharedArrayBuffer2 = r146;
export function isAsyncFunction(a0) {
return c1152_5(a0) === "[object AsyncFunction]";
}
export function isMapIterator(a0) {
return c1152_5(a0) === "[object Map Iterator]";
}
export function isSetIterator(a0) {
return c1152_5(a0) === "[object Set Iterator]";
}
export function isGeneratorObject(a0) {
return c1152_5(a0) === "[object Generator]";
}
export function isWebAssemblyCompiledModule(a0) {
return c1152_5(a0) === "[object WebAssembly.Module]";
}
export function isBoxedPrimitive(a0) {
let r1 = checkBoxedPrimitive(a0, c1152_6) || checkBoxedPrimitive(a0, c1152_7) || checkBoxedPrimitive(a0, c1152_8);
if (!r1) {
let r2 = c1152_3;
if (c1152_3) {
r2 = checkBoxedPrimitive(a0, c1152_9);
}
r1 = r2;
}
if (!r1) {
let r11 = c1152_4;
if (c1152_4) {
r11 = checkBoxedPrimitive(a0, c1152_10);
}
r1 = r11;
}
return r1;
}
export function isAnyArrayBuffer(a0) {
const Uint8Array2 = globalThis.Uint8Array;
let r3 = typeof Uint8Array2 !== "undefined";
if (typeof Uint8Array2 !== "undefined") {
const ArrayBuffer2 = globalThis.ArrayBuffer;
let r1 = typeof ArrayBuffer2 !== "undefined" ? isArrayBufferToString.working ? c1152_5(a0) === "[object ArrayBuffer]" : a0 instanceof ArrayBuffer : typeof ArrayBuffer2 !== "undefined";
if (!r1) {
let r22 = SharedArrayBuffer2 !== void 0;
if (r22) {
if (isSharedArrayBufferToString.working === void 0) {
isSharedArrayBufferToString.working = c1152_5(new SharedArrayBuffer2()) === "[object SharedArrayBuffer]";
}
r22 = isSharedArrayBufferToString.working ? c1152_5(a0) === "[object SharedArrayBuffer]" : a0 instanceof SharedArrayBuffer2;
}
r1 = r22;
}
r3 = r1;
}
return r3;
}
["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(item) {
Object.defineProperty(exports, item, {
enumerable: false,
value: function value() {
throw new Error(item + " is not supported in userland");
}
});
});