Ship 4-digit OTP with rate-limit attempts, Tehran-safe expiry/rass math, larger JSON body limit for check images, and safer order pricing/status guards. Include rebuilt dist for prebuilt deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
1016 B
JavaScript
32 lines
1016 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.tehranCalendarDay = tehranCalendarDay;
|
|
exports.calendarDayOf = calendarDayOf;
|
|
exports.addDays = addDays;
|
|
exports.diffInDays = diffInDays;
|
|
exports.tehranAtHour = tehranAtHour;
|
|
const TEHRAN_OFFSET_MS = (3 * 60 + 30) * 60 * 1000;
|
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
function utcStartOfDay(date) {
|
|
const d = new Date(date);
|
|
d.setUTCHours(0, 0, 0, 0);
|
|
return d;
|
|
}
|
|
function tehranCalendarDay(date) {
|
|
return utcStartOfDay(new Date(date.getTime() + TEHRAN_OFFSET_MS));
|
|
}
|
|
function calendarDayOf(date) {
|
|
return utcStartOfDay(new Date(date));
|
|
}
|
|
function addDays(date, days) {
|
|
return new Date(date.getTime() + days * DAY_MS);
|
|
}
|
|
function diffInDays(from, to) {
|
|
return Math.round((to.getTime() - from.getTime()) / DAY_MS);
|
|
}
|
|
function tehranAtHour(date, hour) {
|
|
return new Date(tehranCalendarDay(date).getTime() +
|
|
hour * 60 * 60 * 1000 -
|
|
TEHRAN_OFFSET_MS);
|
|
}
|
|
//# sourceMappingURL=tehran-time.js.map
|