• Filters out queued chunks based on a predicate.

    Type Parameters

    • In

    • Out

    Parameters

    • predicate: ((chunk) => chunk is Out)
        • (chunk): chunk is Out
        • Parameters

          Returns chunk is Out

    Returns TransformStream<In, Out>

    Example

    --1--2--3--4--5--6--7--8--9--

    filter((x) => x % 2 === 0)

    -----2-----4-----6-----8-----

    Using type guards will extract the types you want to work with.

    --A--B--A--B---

    filter((x): x is B => x.type === 'b')

    -----B-----B--- ```

  • Type Parameters

    • In

    Parameters

    • predicate: Predicate<In>

    Returns TransformStream<In, In>

Generated using TypeDoc