Skip to main content
variable inRange
import { inRange } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Checks if the given number | Date | string falls within the given range.

Use arithmetic comparison to check if the given number is in the specified range. If the second parameter, end, is not specified, the range is considered to be from 0 to start.

type

<T extends number | Date | string>(
n: T,
start: T,
end?: T,
) => unknown