@lou.codes/cron
Version:
⏲️ Cron Quartz and Cron UNIX expression parser
27 lines (26 loc) • 750 B
TypeScript
import type { CronObject } from "./CronObject.js";
/**
* Takes a cron object and returns a sting expression.
*
* @category Cron Object
* @example
* ```typescript
* stringify({}); // "* * * * *"
* stringify({ dayOfMonth: 13, month: 10 }); // "* * 13 10 *"
* stringify({
* minute: 5,
* dayOfMonth: [10, 11, 13],
* month: { from: 1, to: 10 }
* }); // "5 * 10,11,13 1-10 *"
* stringify({ month: 2, dayOfMonth: 31 }); // undefined
* ```
* @see {@link fieldNamesTuple}
* @see {@link stringifyField}
* @see {@link isValidExpression}
*
* @param cron Cron object.
* @returns Cron string expression.
*/
export declare const stringify: (
cron?: Partial<CronObject>,
) => `${string} ${string} ${string} ${string} ${string}` | undefined;