/// /** * Utils for working with Temporal.ZonedDateTime * @module */ import * as Number from "../Number.js"; if (!("Temporal" in globalThis)) { throw new Error("cannot use the temporal functions without the Temporal API"); } const createComparator = (predicate: (a: number, result: number) => boolean) => (a: Temporal.ZonedDateTime, b: Temporal.ZonedDateTime) => { return predicate(Temporal.ZonedDateTime.compare(a, b), 0); }; /** * whether a is equal to b */ export const eq = createComparator(Number.eq); /** * whether a is less then b */ export const lt = createComparator(Number.lt); /** * whether a is less then or equal to b */ export const lte = createComparator(Number.lte); /** * whether a is more then b */ export const gt = createComparator(Number.gt); /** * whether a is more then or equal to b */ export const gte = createComparator(Number.gte);