Attaches constraint values to a type, so that they can be read back off the type object.
import * as t from 'ts-fortress';const Age = t.number(0, { min: 0, max: 120 });const max: 120 = Age.constraints.max;const step: undefined = Age.constraints.step;assert.strictEqual(max, 120);assert.isUndefined(step); Copy
import * as t from 'ts-fortress';const Age = t.number(0, { min: 0, max: 120 });const max: 120 = Age.constraints.max;const step: undefined = Age.constraints.step;assert.strictEqual(max, 120);assert.isUndefined(step);
Attaches constraint values to a type, so that they can be read back off the type object.