Files
discord-decomp/_bundle/endOfWeek.js
T
2026-11-01 12:12:55 +02:00

71 lines
2.0 KiB
JavaScript

// Metro module 3492 (f3493).
import * as _toDate from "./toDate";
import { __esModule } from "./toDate";
import * as _toInteger from "./toInteger";
import * as _requiredArgs from "./requiredArgs";
import { getDefaultOptions } from "./Module3273";
let c1849_2, c1849_3, c1849_4;
export default function endOfWeek(a0, a1) {
(0, c1849_4.default)(1, arguments);
const r25 = (0, getDefaultOptions)();
const default2 = c1849_3.default;
let r9 = a1?.weekStartsOn;
if (!(r9 !== null && r9 !== void 0)) {
const r28 = a1 == null;
let r10 = void 0;
if (!r28) {
const locale = a1.locale;
r10 = void 0;
if (locale !== null) {
r10 = void 0;
if (locale !== void 0) {
const options = locale.options;
r10 = options !== null ? options !== void 0 ? options.weekStartsOn : void 0 : void 0;
}
}
}
r9 = r10;
}
if (!(r9 !== null && r9 !== void 0)) {
r9 = r25.weekStartsOn;
}
if (!(r9 !== null && r9 !== void 0)) {
const locale2 = r25.locale;
let r32 = void 0;
if (locale2 !== null) {
r32 = void 0;
if (locale2 !== void 0) {
const options2 = locale2.options;
r32 = options2 !== null ? options2 !== void 0 ? options2.weekStartsOn : void 0 : void 0;
}
}
r9 = r32;
}
const r35 = default2(r9 !== null ? r9 !== void 0 ? r9 : 0 : 0);
if (r35 >= 0 && r35 <= 6) {
const r45 = (0, c1849_2.default)(a0);
const day = r45.getDay();
const r52 = 6 + (day < r35 ? -7 : 0) - (day - r35);
r45.setDate(r45.getDate() + r52);
r45.setHours(23, 59, 59, 999);
return r45;
}
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
};
c1849_2 = _toDate ? __esModule ? _toDate : {
default: _toDate
} : {
default: _toDate
};
c1849_3 = _toInteger ? _toInteger.__esModule ? _toInteger : {
default: _toInteger
} : {
default: _toInteger
};
c1849_4 = _requiredArgs ? _requiredArgs.__esModule ? _requiredArgs : {
default: _requiredArgs
} : {
default: _requiredArgs
};
module.exports = exports.default;