• Call the predicate on each chunk in the queue. The first chunk to pass the predicate will be queued and the stream will be terminated.

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

    find((x) => x === 6)

    -----------------6-|

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

    --A--A--A--B--X

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

    -----------B--|
  • Type Parameters

    • In

    Parameters

    • predicate: Predicate<In>

    Returns TransformStream<In, In>

Generated using TypeDoc