API reference › @evolu/common › Number › Int0To100OrNonNegativeInt
type Int0To100OrNonNegativeInt = 0 | Int1To100 | NonNegativeInt;
Defined in: packages/common/src/Number.ts:56
Integer literal from 0 to 100 or NonNegativeInt.
Convenience input accepting integer literals from 0 to 100 or an already-validated NonNegativeInt for larger or dynamic values.
Example
import {
assertEqual,
NonNegativeInt,
type Int0To100OrNonNegativeInt,
} from "@evolu/common";
const literal: Int0To100OrNonNegativeInt = 10;
const validated: Int0To100OrNonNegativeInt = NonNegativeInt.orThrow(101);
assertEqual(literal, 10);
assertEqual(validated, 101);