@lou.codes/predicates
Version:
🧐 Predicate util functions
21 lines (20 loc) • 597 B
TypeScript
import type { Numeric } from "@lou.codes/types";
/**
* Takes a `start` and `end` and returns a boolean if `value` number or string is between them.
*
* @category Primitives
* @example
* ```typescript
* const between0 = between(0);
* const between0And10 = between0(10);
*
* between0And10(5); // true
* between0And10(-1); // false
* between0And10(11); // false
* ```
* @param start Minimum boundary.
* @returns Curried function with `start` in context.
*/
export declare const between: (
start: Numeric | string,
) => (end: Numeric | string) => (value: Numeric | string) => boolean;