84 lines
3.6 KiB
TypeScript
84 lines
3.6 KiB
TypeScript
/* Metro module 4136; source: utils/FileSizeUtils.tsx; dependencies: [1244, 2] */
|
|
function _fun34338(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#34338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4307:6, offset: 0x01053560, size: 151 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const closure = formatSize;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = {'useKibibytes': false, 'showDecimalForGB': true, 'useSpace': true};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/FileSizeUtils.tsx');
|
|
exports.BYTE_IN_KB = 1024;
|
|
exports.KB_IN_MB = 1024;
|
|
exports.formatSize = closure;
|
|
exports.formatKbSize = formatKbSize;
|
|
}
|
|
|
|
function formatSize(a0) { // fn#34339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4307:155, offset: 0x010535f7, size: 332 bytes, params: 2, frame: 19
|
|
var useSpace;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
let value = a1;
|
|
let r0 = value !== undefined ? value : env0_3;
|
|
let useKibibytes = r0.useKibibytes;
|
|
value = 1000;
|
|
const r7 = useKibibytes ? env0_2 : value;
|
|
useKibibytes = r0.useKibibytes;
|
|
const r1 = useKibibytes ? 1024 : value;
|
|
let Math = global.Math;
|
|
value = Math.ceil(a0 / r7);
|
|
if (value < r1) {
|
|
useSpace = r0.useSpace;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
r0 = useSpace ? Reflect.apply(formatToPlainString, intl, [t.cS889N,
|
|
{size: value}]) : Reflect.apply(formatToPlainString, intl, [t.pIn7Af, {size: value}]);
|
|
return r0;
|
|
}
|
|
value /= r1;
|
|
const showDecimalForGB = r0.showDecimalForGB;
|
|
Math = global.Math;
|
|
const round = Math.round;
|
|
const r8 = showDecimalForGB ? Reflect.apply(round, Math, [10 * value]) / 10 : Reflect.apply(round, Math, [value]);
|
|
useSpace = r0.useSpace;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
return useSpace ? Reflect.apply(formatToPlainString, intl, [t.yhEXX7,
|
|
{size: r8}]) : Reflect.apply(formatToPlainString, intl, [t.TbMX9D, {size: r8}]);
|
|
}
|
|
|
|
function formatKbSize(a0) { // fn#34340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4307:727, offset: 0x01053743, size: 229 bytes, params: 2, frame: 19
|
|
var useSpace;
|
|
var intl;
|
|
var formatToPlainString;
|
|
var t;
|
|
var kEk9pr;
|
|
var object2;
|
|
var bTzRR6;
|
|
let value = a1;
|
|
const r4 = value !== undefined ? value : env0_3;
|
|
let useKibibytes = r4.useKibibytes;
|
|
value = 1000;
|
|
const value3 = a0 / (useKibibytes ? 1024 : value);
|
|
useKibibytes = r4.useKibibytes;
|
|
let r0 = useKibibytes ? env0_2 : value;
|
|
if (value3 / r0 >= 1) {
|
|
r0 = formatSize(value3, r4);
|
|
} else {
|
|
useSpace = r4.useSpace;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
if (useSpace) {
|
|
bTzRR6 = t.bTzRR6;
|
|
object2 = {};
|
|
object2.size = global.Math.ceil(value3);
|
|
r0 = Reflect.apply(formatToPlainString, intl, [bTzRR6, object2]);
|
|
} else {
|
|
kEk9pr = t.kEk9pr;
|
|
object2 = {};
|
|
object2.size = global.Math.ceil(value3);
|
|
r0 = Reflect.apply(formatToPlainString, intl, [kEk9pr, object2]);
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|