Skip to content

Commit

Permalink
Revert "Update intersect typings, the second collection can be differ…
Browse files Browse the repository at this point in the history
…ent if comparer is provided."

This reverts commit c8ba256.
  • Loading branch information
Indomitable committed Aug 22, 2019
1 parent e46ba14 commit 50fa129
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 1 addition & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,13 @@ declare module 'modern-linq' {
*/
union(secondIterable: Iterable<TValue>): LinqIterable<TValue>;

/**
* Return an intersection of two iterables where the result is distinct values.
* @param secondIterable
*/
intersect(secondIterable: Iterable<TValue>): LinqIterable<TValue>;

/**
* Return an intersection of two iterables where the result is distinct values.
* @param secondIterable
* @param comparer optional predicate, if none is provided a default one (===) is used.
*/
intersect<TSecond = TValue>(secondIterable: Iterable<TSecond>, comparer?: (first: TValue, second: TSecond) => boolean): LinqIterable<TValue>;
intersect(secondIterable: Iterable<TValue>, comparer?: (first: TValue, second: TValue) => boolean): LinqIterable<TValue>;

/**
* Create a paging
Expand Down
2 changes: 0 additions & 2 deletions test/ts/tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,5 @@ describe("typescript tests", () => {
expect(from(new Set([1, 2, 3])).intersect([3, 2]).toArray()).to.deep.equal([2, 3]);
expect(from([1, 2, 3, 2]).intersect([3, 2, 3]).toArray()).to.deep.equal([2, 3]);
expect(from([1, 2, 3, 2]).intersect([3, 2, 3], (a, b) => a === b).toArray()).to.deep.equal([2, 3]);

expect(from([1, 2, 3, 2]).intersect(['1', '2'], (a, b) => a.toString() === b).toArray()).to.deep.equal([1, 2]);
});
});

0 comments on commit 50fa129

Please sign in to comment.