ts-type-forge
    Preparing search index...

    Type Alias Int

    Int: TSTypeForgeInternals_ExtendNumberBrand<FiniteNumber, "Int">

    Branded numeric type for integers. Represents values that pass Number.isInteger(x) check.

    const isInt = (x: number): x is Int => Number.isInteger(x);

    const getArrayElement = <T>(arr: readonly T[], index: Int & NonNegativeNumber) =>
    arr[index];

    const factorial = (n: Int & NonNegativeNumber): Int =>
    n === 0 ? 1 as Int : (n * factorial((n - 1) as Int & NonNegativeNumber)) as Int;