[ramda] Updated differenceWith typing

This commit is contained in:
rayhaneh
2018-05-28 15:45:40 -04:00
parent 86fa899b1f
commit eacae91146
2 changed files with 5 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
// Bonggyun Lee <https://github.com/deptno>
// Maciek Blim <https://github.com/blimusiek>
// Marcin Biernat <https://github.com/biern>
// Rayhaneh Banyassady <https://github.com/rayhaneh>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -523,6 +524,7 @@ declare namespace R {
* elements.
*/
differenceWith<T>(pred: (a: T, b: T) => boolean, list1: ReadonlyArray<T>, list2: ReadonlyArray<T>): T[];
differenceWith<T>(pred: (a: T, b: T) => boolean): <T> (list1: ReadonlyArray<T>, list2: ReadonlyArray<T>) => T[];
/*
* Returns a new object that does not contain a prop property.

View File

@@ -1957,6 +1957,9 @@ class Rectangle {
const l1 = [{a: 1}, {a: 2}, {a: 3}];
const l2 = [{a: 3}, {a: 4}];
R.differenceWith(cmp, l1, l2); // => [{a: 1}, {a: 2}]
const differenceWithCurried = R.differenceWith(cmp);
differenceWithCurried(l1, l2); // =>[{a: 1}, {a: 2}]
};
() => {