91 lines
3.8 KiB
TypeScript
91 lines
3.8 KiB
TypeScript
/* Metro module 1858; source: modules/collectibles/utils/mappers.tsx; dependencies: [2] */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun20028(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#20028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1985:6, offset: 0x00ebcd67, size: 109 bytes, params: 8, frame: 17
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const closure = function(a0) {
|
|
return typeof a0.skuId === 'string' || typeof a0.skuId === 'number' ? global.String(a0.skuId) : typeof a0.sku_id === 'string' ? global.String(a0.sku_id) : typeof a0.sku_id !== 'number' ? null : global.String(a0.sku_id);
|
|
};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/utils/mappers.tsx');
|
|
exports.parseSkuIdFromServerData = closure;
|
|
exports.parseServerUserCollectibles = parseServerUserCollectibles;
|
|
function parseServerUserNameplate(a0) { // fn#20029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1985:266, offset: 0x00ebcdd4, size: 273 bytes, params: 2, frame: 14
|
|
var r3;
|
|
var palette;
|
|
var object;
|
|
if (typeof a0 === 'object') {
|
|
if (a0 == null) {
|
|
return null;
|
|
}
|
|
var value;
|
|
value = parseSkuIdFromServerData(a0);
|
|
if (value == null) {
|
|
return null;
|
|
}
|
|
if ('label' in a0) {
|
|
if (typeof a0.label !== 'string') {
|
|
return null;
|
|
}
|
|
if ('palette' in a0) {
|
|
palette = a0.palette;
|
|
if (typeof palette !== 'string') {
|
|
return null;
|
|
}
|
|
object = {skuId: value};
|
|
object.label = a0.label;
|
|
palette = a0.palette;
|
|
object.palette = palette;
|
|
value = 'asset' in a0;
|
|
r3 = value && typeof a0.asset === 'string';
|
|
if (r3) {
|
|
object.asset = a0.asset;
|
|
}
|
|
value = 'expiresAt' in a0;
|
|
r3 = value && typeof a0.expiresAt === 'number';
|
|
if (r3) {
|
|
object.expiresAt = a0.expiresAt;
|
|
}
|
|
value = 'expires_at' in a0;
|
|
r3 = value && typeof a0.expires_at === 'number';
|
|
if (r3) {
|
|
object.expiresAt = a0.expires_at;
|
|
}
|
|
return object;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function parseServerUserCollectibles(a0) { // fn#20031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1985:935, offset: 0x00ebcf51, size: 90 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r0;
|
|
var object;
|
|
const value = null;
|
|
if (typeof a0 !== 'object') {
|
|
r0 = value;
|
|
} else if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
if ('nameplate' in a0) {
|
|
if (typeof a0.nameplate !== 'object') {
|
|
r1 = value;
|
|
} else {
|
|
object = {};
|
|
object.nameplate = parseServerUserNameplate(a0.nameplate);
|
|
r1 = object;
|
|
}
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun20028, 1858, [2]) /* metro module 1858, dependencies: [2] */;
|