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 { buildUnicode, DIGIT, END, group, join, or, range, set, START, } from "jsr:@coven/expression@^0.3.3"; import { test } from "jsr:@coven/predicates@^0.3.3"; import { paddedRegExp } from "./paddedRegExp.ts"; /** * Matches only valid number values for a cron expression (from `0` or `00` to * `59`). * * @example * ```typescript * parseNumberTest("13"); // true * parseNumberTest("05"); // true * parseNumberTest("60"); // false * parseNumberTest("foo"); // false * ``` * * @see {@linkcode paddedRegExp} */ export const parseNumberTest: (text: string) => boolean = test( buildUnicode( START, group(or(paddedRegExp(DIGIT), join(set(range(1)(5)), DIGIT))), END, ), );