ts-type-forge
    Preparing search index...

    Type Alias PositiveInt

    Branded numeric type for positive integers. Represents integers strictly greater than zero.

    const isPositiveInt = (x: number): x is PositiveInt =>
    Number.isInteger(x) && x > 0;

    const take = <T>(arr: readonly T[], n: PositiveInt): T[] =>
    arr.slice(0, n);

    const id = (value: PositiveInt) => ({ id: value });