decord/source/modules/collectibles/utils/mappers.tsx

96 lines
3.4 KiB
TypeScript
Raw Normal View History

2026-08-11 06:20:06 +00:00
// Module ID: 1900
// Function ID: 1901
2026-07-20 16:05:17 +00:00
// Name: parseSkuIdFromServerData
2026-07-23 10:11:24 +00:00
// Dependencies: [2]
2026-07-29 08:29:29 +00:00
// Exports: parseServerUserCollectibles, parseSkuIdFromServerData
2026-07-20 16:05:17 +00:00
2026-08-11 06:20:06 +00:00
// Module 1900 (parseSkuIdFromServerData)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
const result = set.fileFinishedImporting("modules/collectibles/utils/mappers.tsx");
2026-07-29 08:29:29 +00:00
export const parseSkuIdFromServerData = function parseSkuIdFromServerData(skuId) {
2026-08-04 21:03:28 +00:00
if (typeof skuId.skuId !== "string") {
if (typeof skuId.skuId !== "number") {
if (typeof skuId.sku_id === "string") {
2026-07-20 16:05:17 +00:00
const _String = String;
let StringResult = String(skuId.sku_id);
} else {
StringResult = null;
}
}
return StringResult;
}
StringResult = String(skuId.skuId);
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const parseServerUserCollectibles = function parseServerUserCollectibles(collectibles) {
let tmp = null;
2026-08-04 21:03:28 +00:00
if (typeof collectibles === "object") {
2026-07-20 16:05:17 +00:00
tmp = null;
if (null != collectibles) {
let tmp2 = null;
if ("nameplate" in collectibles) {
tmp2 = null;
2026-08-04 21:03:28 +00:00
if (typeof collectibles.nameplate === "object") {
2026-07-29 08:29:29 +00:00
const nameplate = collectibles.nameplate;
let tmp6 = null;
2026-08-04 21:03:28 +00:00
if (typeof nameplate === "object") {
2026-07-29 08:29:29 +00:00
tmp6 = null;
if (null != nameplate) {
2026-08-04 21:03:28 +00:00
if (typeof nameplate.skuId !== "string") {
if (typeof nameplate.skuId !== "number") {
if (typeof nameplate.sku_id === "string") {
2026-07-29 08:29:29 +00:00
const _String = String;
let StringResult = String(nameplate.sku_id);
} else {
StringResult = null;
}
}
tmp6 = null;
if (null != StringResult) {
tmp6 = null;
if ("label" in nameplate) {
tmp6 = null;
2026-08-04 21:03:28 +00:00
if (typeof nameplate.label === "string") {
2026-07-29 08:29:29 +00:00
tmp6 = null;
if ("palette" in nameplate) {
tmp6 = null;
2026-08-04 21:03:28 +00:00
if (typeof nameplate.palette === "string") {
2026-07-29 08:29:29 +00:00
let obj = { skuId: null, label: null, palette: null };
obj[0] = StringResult;
({ label: obj2[1], palette: obj2[2] } = nameplate);
if (tmp7) {
obj.asset = nameplate.asset;
}
if (tmp8) {
obj.expiresAt = nameplate.expiresAt;
}
tmp6 = obj;
if (tmp9) {
obj.expiresAt = nameplate.expires_at;
tmp6 = obj;
}
2026-08-04 21:03:28 +00:00
tmp7 = "asset" in nameplate && typeof nameplate.asset === "string";
tmp8 = "expiresAt" in nameplate && typeof nameplate.expiresAt === "number";
tmp9 = "expires_at" in nameplate && typeof nameplate.expires_at === "number";
2026-07-29 08:29:29 +00:00
}
}
}
}
}
}
const _String2 = String;
StringResult = String(nameplate.skuId);
}
}
obj = { nameplate: null };
obj[0] = tmp6;
2026-07-20 16:05:17 +00:00
tmp2 = obj;
}
}
tmp = tmp2;
}
}
return tmp;
};