UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

19 lines (18 loc) 866 B
/** * Return true if `start` and `end` form a valid Unix interval — both finite numbers * and `start <= end`. * * - Both inputs must be numbers (or numeric strings that coerce to finite numbers). * - Equal `start === end` is valid. * - Non-finite values (NaN, Infinity) return `false`. * * @param start Unix epoch value (seconds or milliseconds) — interval start * @param end Unix epoch value (seconds or milliseconds) — interval end * @returns true if start and end form a valid Unix interval, or false on invalid input * * @example isValidUnixInterval(0, 1700000000) // true * @example isValidUnixInterval(1000, 1000) // true * @example isValidUnixInterval(1700000000, 0) // false * @example isValidUnixInterval("0", "1700000000") // true */ export declare function isValidUnixInterval(start: number | string, end: number | string): boolean;