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