Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
⏳ Fantastic cron parser and constructor.
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
JSR Score
100%
Published
2 months ago (0.3.3)
import { group, join, optional } from "jsr:@coven/expression@^0.3.3"; import { RANGE_EXPRESSION_SEPARATOR_TOKEN } from "./tokens.ts"; /** * Regular expression to match values or ranges. * * @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 const valueOrRangeRegExp = <Value extends number | string>( value: Value, ): `${Value}(?:-${Value})?` => join(value, optional(group(RANGE_EXPRESSION_SEPARATOR_TOKEN, value)));