iter-fns - v0.13.0
    Preparing search index...

    Function partition

    • Partitions an iterator into an array of items that match the predicate and an array of items that do not match the predicate.

      Type Parameters

      • T

        type of the item

      • S

      Parameters

      • iterable: Iterable<T>

        the iterable

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

        the predicate

      Returns [S[], Exclude<T, S>[]]

    • Partitions an iterator into an array of items that match the predicate and an array of items that do not match the predicate.

      Type Parameters

      • T

        type of the item

      Parameters

      • iterable: Iterable<T>

        the iterable

      • p: (x: T, i: number) => boolean

        the predicate

      Returns [T[], T[]]