UNPKG

@lou.codes/cron

Version:

⏲️ Cron Quartz and Cron UNIX expression parser

33 lines (32 loc) 978 B
import type { CronObject } from "./CronObject.js"; /** * Given an iterable of tuples with the name of a field and a field value, * run each field through {@link parseField}. * * @category Cron String * @example * ```typescript * parseFieldTuplesMap([["minute", "*"]]); // [["minute", "*"]] * parseFieldTuplesMap([["minute", "13"]]); // [["minute", 13]] * parseFieldTuplesMap([["minute", "10,11,13"]]); // [["minute", [10, 11, 13]]] * parseFieldTuplesMap([["minute", "1-10"]]); // [["minute", { from: 1, to: 10 }]] * ``` * @see {@link parseField} */ export declare const parseFieldTuplesMap: ( iterable: Readonly< Iterable<readonly [name: keyof CronObject, field: string]> >, ) => Readonly< IterableIterator< readonly [ "minute" | "hour" | "dayOfMonth" | "month" | "dayOfWeek", ( | "*" | import("./RangeField.js").RangeField<number> | import("./ListField.js").ListField<number> | import("@lou.codes/types").Maybe<number> ), ] > >;