decord/alpha/source/modules/gateway/GatewayEncoding.tsx

53 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 14268
// Function ID: 14269
// Name: GatewayEncoding
2026-10-13 12:43:34 +00:00
// Dependencies: [14269, 6911, 2]
2026-07-20 16:05:17 +00:00
2026-10-13 12:43:34 +00:00
// Module 14268 (GatewayEncoding)
2026-10-12 06:59:38 +00:00
import ProcessArgs2 from "ProcessArgs" /* 6911 */;
2026-10-13 12:43:34 +00:00
import GatewayEncodingErlpackEncoding_mod from "GatewayEncodingErlpackEncoding" /* 14269 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
let GatewayEncodingErlpackEncoding = GatewayEncodingErlpackEncoding_mod;
GatewayEncodingErlpackEncoding = GatewayEncodingErlpackEncoding.getErlpackEncoding();
2026-07-29 08:29:29 +00:00
class JSONEncoding {
2026-10-03 08:58:59 +00:00
pack(arg0) {
return JSON.stringify(arg0);
}
unpack(str) {
if (typeof str !== "string") {
let tmp2 = null;
const _Error = Error;
if (null != str) {
tmp2 = typeof str;
}
const _HermesInternal = HermesInternal;
const self = this;
const self2 = this;
const _Error1 = new _Error("Expected a string to be passed to JSONEncoding.unpack, got " + tmp2);
throw _Error1;
} else {
const _JSON = JSON;
return JSON.parse(str);
2026-07-20 16:05:17 +00:00
}
}
2026-10-03 08:58:59 +00:00
getName() {
return "json";
}
wantsString() {
return true;
}
}
const prototype = JSONEncoding.prototype;
2026-07-29 08:29:29 +00:00
let tmp3 = JSONEncoding;
if (undefined !== GatewayEncodingErlpackEncoding) {
tmp3 = GatewayEncodingErlpackEncoding;
2026-07-20 16:05:17 +00:00
}
const ProcessArgs = ProcessArgs2.ProcessArgs;
2026-07-20 16:05:17 +00:00
if (ProcessArgs.isDiscordGatewayPlaintextSet()) {
2026-07-29 08:29:29 +00:00
tmp3 = JSONEncoding;
2026-07-20 16:05:17 +00:00
}
const result = size.fileFinishedImporting("modules/gateway/GatewayEncoding.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default tmp3;