decord/source/modules/gateway/GatewayEncoding.tsx

50 lines
1.4 KiB
TypeScript
Raw Normal View History

// Module ID: 13688
// Function ID: 13689
// Name: GatewayEncoding
// Dependencies: [13689, 5193, 2]
2026-07-20 16:05:17 +00:00
// Module 13688 (GatewayEncoding)
import ProcessArgs2 from "ProcessArgs" /* 5193 */;
import GatewayEncodingErlpackEncoding_mod from "GatewayEncodingErlpackEncoding" /* 13689 */;
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 {
}
const prototype = JSONEncoding.prototype;
prototype["pack"] = function pack(arg0) {
return JSON.stringify(arg0);
};
2026-08-04 21:03:28 +00:00
prototype["unpack"] = function unpack(str) {
if (typeof str !== "string") {
2026-07-29 08:29:29 +00:00
let tmp2 = null;
2026-08-04 21:03:28 +00:00
if (null != str) {
tmp2 = typeof str;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal;
const error = new Error("Expected a string to be passed to JSONEncoding.unpack, got " + tmp2);
2026-07-29 08:29:29 +00:00
throw error;
} else {
const _JSON = JSON;
2026-08-04 21:03:28 +00:00
return JSON.parse(str);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
prototype["getName"] = function getName() {
return "json";
};
prototype["wantsString"] = function wantsString() {
return true;
};
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;