UNPKG

@lou.codes/cron

Version:

⏲️ Cron Quartz and Cron UNIX expression parser

20 lines (19 loc) 574 B
import type { Maybe } from "@lou.codes/types"; import type { Field } from "./Field.js"; import type { RangeString } from "./RangeString.js"; /** * Turn a cron range into a string. * * @category Cron Object * @example * ```typescript * parseRange({ from: 1, to: 13 }); // "1-13" * ``` * @see {@link isRangeField} * * @param field Cron field to turn into a string. * @returns String ranged of `undefined` if it isn't a range object. */ export declare const stringifyRange: <Predicated extends number>( field: Readonly<Field<Predicated>>, ) => Maybe<RangeString>;