mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 23:37:04 +00:00
Merge pull request #26091 from rayhaneh/Ramda-differenceWith-Typing
[ramda] Updated differenceWith typing
This commit is contained in:
Vendored
+3
@@ -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,8 @@ 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): (list1: ReadonlyArray<T>, list2: ReadonlyArray<T>) => T[];
|
||||
differenceWith<T>(pred: (a: T, b: T) => boolean, list1: ReadonlyArray<T>): (list2: ReadonlyArray<T>) => T[];
|
||||
|
||||
/*
|
||||
* Returns a new object that does not contain a prop property.
|
||||
|
||||
@@ -1957,6 +1957,12 @@ 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 differenceWithCurried1 = R.differenceWith(cmp);
|
||||
differenceWithCurried1(l1, l2); // =>[{a: 1}, {a: 2}]
|
||||
|
||||
const differenceWithCurried2 = R.differenceWith(cmp, l1);
|
||||
differenceWithCurried2(l2); // =>[{a: 1}, {a: 2}]
|
||||
};
|
||||
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user