Prelude API
    Preparing search index...

    Function zipRecord

    • Creates a generator that yields objects where each property comes from the corresponding position in the input iterables. Stops when any of the input iterables is exhausted.

      Type Parameters

      • Arg extends { [key: string]: Iterable<unknown, any, any> }

        Type of the input record of iterables

      Parameters

      • iterables: Arg

        Record of iterables to zip

      Returns Generator<{ [K in string | number | symbol]: Value<Arg[K]> }>

      Object with the same keys as the input, where each value comes from the corresponding iterable

      const names = ['Alice', 'Bob', 'Charlie'];
      const ages = [25, 30, 35];

      const records = G.pipe(
      G.zipRecord({ name: names, age: ages }),
      G.array
      );
      // => [{ name: 'Alice', age: 25 }, { name: 'Bob', age: 30 }, { name: 'Charlie', age: 35 }]