@lou.codes/cron
Version:
⏲️ Cron Quartz and Cron UNIX expression parser
20 lines (19 loc) • 529 B
TypeScript
import type { Maybe } from "@lou.codes/types";
import type { ListField } from "./ListField.js";
/**
* Parses a cron list into an array.
*
* @category Cron String
* @example
* ```typescript
* parseList("10,11,13"); // [10, 11, 13]
* ```
* @see {@link isListString}
* @see {@link parseRange}
*
* @param value String that might be a list.
* @returns Parsed list of `undefined` if it isn't a list string.
*/
export declare const parseList: <Predicated extends number>(
value: string,
) => Maybe<ListField<Predicated>>;