Skip to main content

@coven/cron@0.3.3
Built and signed on GitHub Actions

⏳ Fantastic cron parser and constructor.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (0.3.3)
Package root>valueRangeOrListRegExp.ts
import { valueOrListRegExp } from "./valueOrListRegExp.ts"; import { valueOrRangeRegExp } from "./valueOrRangeRegExp.ts"; /** * Regular expression to match values, ranges or lists. * * @example * ```typescript * valueRangeOrListRegExp(13); // "(?:13(?:-13)?|(?:(?:13(?:-13)?,)+13(?:-13)?))" * ``` * @param value Value to match by itself, as a range or as a list. * @returns RegExp to match value, range or list. */ export const valueRangeOrListRegExp = <Value extends number | string>( value: Value, ): `(?:${Value}(?:-${Value})?|(?:(?:${Value}(?:-${Value})?,)+${Value}(?:-${Value})?))` => valueOrListRegExp(valueOrRangeRegExp(value));