Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
// Module ID: 13175
|
|
// Function ID: 13176
|
|
// Name: GatewayEncoding
|
|
// Dependencies: [13176, 5453, 2]
|
|
|
|
// Module 13175 (GatewayEncoding)
|
|
import ProcessArgs2 from "ProcessArgs" /* 5453 */;
|
|
import GatewayEncodingErlpackEncoding_mod from "GatewayEncodingErlpackEncoding" /* 13176 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let GatewayEncodingErlpackEncoding = GatewayEncodingErlpackEncoding_mod;
|
|
GatewayEncodingErlpackEncoding = GatewayEncodingErlpackEncoding.getErlpackEncoding();
|
|
class JSONEncoding {
|
|
}
|
|
const prototype = JSONEncoding.prototype;
|
|
prototype["pack"] = function pack(arg0) {
|
|
return JSON.stringify(arg0);
|
|
};
|
|
prototype["unpack"] = function unpack(str) {
|
|
if (typeof str !== "string") {
|
|
let tmp2 = null;
|
|
if (null != str) {
|
|
tmp2 = typeof str;
|
|
}
|
|
const _HermesInternal = HermesInternal;
|
|
const error = new Error("Expected a string to be passed to JSONEncoding.unpack, got " + tmp2);
|
|
throw error;
|
|
} else {
|
|
const _JSON = JSON;
|
|
return JSON.parse(str);
|
|
}
|
|
};
|
|
prototype["getName"] = function getName() {
|
|
return "json";
|
|
};
|
|
prototype["wantsString"] = function wantsString() {
|
|
return true;
|
|
};
|
|
let tmp3 = JSONEncoding;
|
|
if (undefined !== GatewayEncodingErlpackEncoding) {
|
|
tmp3 = GatewayEncodingErlpackEncoding;
|
|
}
|
|
const ProcessArgs = ProcessArgs2.ProcessArgs;
|
|
if (ProcessArgs.isDiscordGatewayPlaintextSet()) {
|
|
tmp3 = JSONEncoding;
|
|
}
|
|
const result = size.fileFinishedImporting("modules/gateway/GatewayEncoding.tsx");
|
|
|
|
export default tmp3;
|