Creates a number shape.
Contradictory constraints are rejected as the shape is built, so a shape that exists admits at least one value.
The stated constraints
Optionalconstraints: COptional shape constraints
An immutable shape admitting the numbers the constraints bound, narrowed to the values they enumerate
TraceError Where the stated constraints contradict one another
Creates a number shape admitting an enumerated set of values.
Reads bare numbers as the enumeration closing the domain to them, so that a set of admitted values is stated as
number(1, 2, 3) rather than as number({ in: [1, 2, 3] }).
The values the shape admits
The admitted values
An immutable shape admitting values alone
Creates a number shape.