@metreeca/pipe - v0.9.20
    Preparing search index...

    Function every

    • Creates a sink checking if all items satisfy the predicate.

      Type Parameters

      • V

        The type of items in the stream

      Parameters

      • predicate: (item: V) => boolean | Promise<boolean>

        The function to test each item

      Returns Sink<V, boolean>

      A sink that checks if all items satisfy the predicate

      await items([2, 4, 6, 8])(every(x => x%2 === 0));  // true
      await items([2, 3, 4])(every(x => x%2 === 0)); // false