mihaifm / linq

linq.js - LINQ for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

argument of .zip()

kasugaiasuka opened this issue · comments

IEnumerable<T>.zip() accepts U[] (or IEnumerable<U>) as the first argument.

Enumerable.from([1, 2, 3])
    .zip(["a", "b", "c"], (first, second) => `${first}${second}`)
    .toArray();

// => ["1a", "2b", "3c"]

So, definitions should be like this:

zip<U, TResult>(second: IEnumerable<U>, resultSelector: (first: T, second: U, index: number) => TResult): IEnumerable<TResult>;
zip<U, TResult>(second: { length: number;[x: number]: U; }, resultSelector: (first: T, second: U, index: number) => TResult): IEnumerable<TResult>;
zip<U, TResult>(second: U[], resultSelector: (first: T, second: U, index: number) => TResult): IEnumerable<TResult>;

This seems to be correct, I will make the changes.

Resolved (b815a82), thanks for your help.