@bitty/predicate
Version:
Predicate helper functions and types for TypeScript.
9 lines • 300 B
TypeScript
/**
* A function that check if value (`T`) matches some predicate.
*/
export type Predicate<T = unknown> = (value: T) => boolean;
/**
* A function that check if value (`T`) is of type `T2`.
*/
export type Refinement<T, T2 extends T> = (value: T) => value is T2;
//# sourceMappingURL=main.d.ts.map