@lou.codes/cron
Version:
⏲️ Cron Quartz and Cron UNIX expression parser
15 lines (14 loc) • 404 B
TypeScript
/**
* Regular expression to match lists.
*
* @category Regular Expression
* @example
* ```typescript
* valueOrListRegExp(13); // "(?:13|(?:(?:13,)+13))"
* ```
* @param value Value to match by itself or as a list.
* @returns RegExp to match value or list.
*/
export declare const valueOrListRegExp: <Value extends number | string>(
value: Value,
) => `(?:${Value}|(?:(?:${Value},)+${Value}))`;