Refinement
Refinement<
A,B> = (a) =>a is B
Defined in: Core/Refinement.ts:26
A function from A to A is B — a type predicate paired with a runtime check.
A Refinement<A, B> proves at compile time that a value of type A is actually
the narrower type B extends A, backed by a runtime boolean test. Use it to
express domain invariants (non-empty strings, positive numbers, valid emails) as
first-class, composable values rather than one-off type guards scattered across
the codebase.
Type Parameters
Section titled “Type Parameters”A
B extends A
Parameters
Section titled “Parameters”A
Returns
Section titled “Returns”a is B