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 { exists, group, or } from "jsr:@coven/expression@^0.3.3"; import { LIST_EXPRESSION_SEPARATOR_TOKEN } from "./tokens.ts"; /** * Regular expression to match lists. * * @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 const valueOrListRegExp = <Value extends number | string>( value: Value, ): `(?:${Value}|(?:(?:${Value},)+${Value}))` => group( or( value, group(exists(group(value, LIST_EXPRESSION_SEPARATOR_TOKEN)), value), ), );