Documentation
    Preparing search index...

    Function filter

    • Filters out queued chunks based on a predicate.

      Type Parameters

      • In
      • Out

      Parameters

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

      Returns TransformStream<In, Out>

      --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---

      
      
    • Filters out queued chunks based on a predicate.

      Type Parameters

      • In

      Parameters

      • predicate: Predicate<In>

      Returns TransformStream<In, In>

      --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---