decord/stable/source/modules/gateway/GatewayEncoding.tsx
github-actions e2bc0408ee chore: update source for stable 346.13
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-22 22:11:40 +00:00

49 lines
1.4 KiB
TypeScript

// Module ID: 13721
// Function ID: 13722
// Name: GatewayEncoding
// Dependencies: [13722, 5222, 2]
// Module 13721 (GatewayEncoding)
import ProcessArgs2 from "ProcessArgs" /* 5222 */;
import GatewayEncodingErlpackEncoding_mod from "GatewayEncodingErlpackEncoding" /* 13722 */;
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;