decord/source/modules/gateway/GatewayEncoding.tsx

49 lines
1.2 KiB
TypeScript
Raw Normal View History

// Module ID: 13631
// Function ID: 13632
2026-07-29 08:29:29 +00:00
// Name: pack
// Dependencies: [13632, 5141, 2]
2026-07-20 16:05:17 +00:00
// Module 13631 (pack)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import get from "get" /* 5141 */;
import getErlpackEncoding from "getErlpackEncoding" /* 13632 */;
2026-07-23 10:11:24 +00:00
getErlpackEncoding = getErlpackEncoding.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;
2026-08-24 06:08:38 +00:00
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;
2026-07-23 10:11:24 +00:00
if (undefined !== getErlpackEncoding) {
2026-07-29 08:29:29 +00:00
tmp3 = getErlpackEncoding;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const ProcessArgs = get.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
}
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/gateway/GatewayEncoding.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default tmp3;