ts-iterable-functions
    Preparing search index...

    Type Alias TypeGuardPredicate<T, S>

    TypeGuardPredicate: (x: T, i: number) => x is S

    Represents a predicate function that both narrows the type of its input and tracks the element index.

    Type Parameters

    • T

      The broader type of the value being evaluated.

    • S extends T

      The narrower subtype asserted when the predicate returns true.

    Type Declaration

      • (x: T, i: number): x is S
      • Parameters

        • x: T

          The value under test, belonging to the broader type T.

        • i: number

          The zero-based index of the value within the source iterable.

        Returns x is S

        A type guard asserting that x is of subtype S.