ts-type-forge
    Preparing search index...

    Type Alias Uint

    Alias for NonNegativeInt. Branded numeric type for unsigned integers (non-negative integers). Represents integers greater than or equal to zero.

    const isUint = (x: number): x is Uint =>
    Number.isInteger(x) && x >= 0;

    const arrayLength = (arr: readonly unknown[]): Uint =>
    arr.length as Uint;

    const repeat = (str: string, count: Uint) => str.repeat(count);