ts-iterable-functions
    Preparing search index...

    Function unwrapIndexedConst

    • Restores the original sequence order from an iterable of value-index tuples.

      Curried version of _unwrapIndexed.

      Type Parameters

      • T

        Element type contained in each indexed entry.

      Returns (src: Iterable) => Iterable

      A deferred iterable yielding the values ordered by their stored indices.

      const indexed: Indexed<string>[] = [
      ["two", 1],
      ["zero", 0],
      ["one", 2],
      ];
      const values = [..._unwrapIndexed(indexed)];
      console.log(values); // ["zero", "two", "one"]

      or using the curried version:

      const values = [
      ...pipeInto(
      [
      ["two", 1],
      ["zero", 0],
      ["one", 2],
      ] as Indexed<string>[],
      unwrapIndexed()
      ),
      ];
      console.log(values); // ["zero", "two", "one"]