@szilanor/stream
    Preparing search index...

    Function withIndex

    • Returns an OperationFunction that yields elements from the source with their index.

      Type Parameters

      • T

        Type of items in the source.

      Returns OperationFunction<T, [T, number]>

      An OperationFunction that yields elements from the source with their index.

      const result = withIndex<number>()([1, 2, 3]);
      console.log([...result]); // [[1, 0], [2, 1], [3, 2]]