ts-type-forge
    Preparing search index...

    Type Alias NonNegativeInt

    Branded numeric type for non-negative integers. Represents integers greater than or equal to zero.

    const isNonNegativeInt = (x: number): x is NonNegativeInt =>
    Number.isInteger(x) && x >= 0;

    const arrayIndex = (arr: readonly unknown[], i: NonNegativeInt) => arr[i];
    const count = (items: NonNegativeInt) => ({ count: items });