Files
discord-decomp/sources/by-id/module-03643.jsx
T
2026-07-27 16:20:00 +03:00

49 lines
2.4 KiB
React

/* Metro module 3643; source: unknown; dependencies: [3235, 3239, 3429] */
function _fun27833(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#27833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3770:6, offset: 0x00f62ca8, size: 126 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = function(a0) {
var value = a0;
return value && value.__esModule ? value : {default: value};
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
exports.default = roundToNearestMinutes;
const env0_2 = closure(require(3235) /* metro dependency 3235 */);
const env0_3 = closure(require(3239) /* metro dependency 3239 */);
module.exports = exports.default;
}
function roundToNearestMinutes(a0, a1) { // fn#27835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3770:102, offset: 0x00f62d26, size: 371 bytes, params: 3, frame: 21
let value = undefined;
const value2 = 1;
if (arguments.length < value2) {
throw new global.TypeError('1 argument required, but only none provided present');
}
const property = env0_3.default;
const nearestTo = a1 == null ? value : a1.nearestTo;
const value4 = property(nearestTo === null || value === nearestTo ? value2 : nearestTo);
if (value4 < value2) {
throw new global.RangeError('`options.nearestTo` must be between 1 and 30');
}
if (value4 > 30) {
throw new global.RangeError('`options.nearestTo` must be between 1 and 30');
}
const value5 = (0, env0_2.default)(a0);
const value8 = value5.getMinutes() + value5.getSeconds() / 60;
const getRoundingMethod = (require(3429) /* metro dependency 3429 */).getRoundingMethod;
value = getRoundingMethod(a1 == null ? value : a1.roundingMethod)(value8 / value4) * value4;
const value10 = value8 % value4;
const Math = global.Math;
const value11 = Math.round(value10 / value4) * value4;
const Date = global.Date;
const fullYear = value5.getFullYear();
const month = value5.getMonth();
const date2 = value5.getDate();
const hours = value5.getHours();
value += value11;
const value16 = Object.create(Date.prototype, {constructor: {value: Date}});
const date = new Date(fullYear, month, date2, hours, value);
return date instanceof Object ? date : value16;
}