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>isRangeField.ts
import { has, isNumber, isObject } from "jsr:@coven/predicates@^0.3.3"; import type { RangeField } from "./RangeField.ts"; import { FROM_NAME, TO_NAME } from "./rangeFieldNames.ts"; const hasFrom = has(FROM_NAME); const hasTo = has(TO_NAME); /** * Predicate checking if given value is a cron object range ({@linkcode RangeField}). * * @see {@linkcode RangeField} */ export const isRangeField = (value: unknown): value is RangeField<number> => isObject(value) && hasFrom(value) && hasTo(value) && isNumber(value[FROM_NAME]) && isNumber(value[TO_NAME]) && value[FROM_NAME] < value[TO_NAME];