add R.project curry definition (#25635)

* fix R.project curry

* mend
This commit is contained in:
Bonggyun Lee
2018-05-09 11:40:44 -07:00
committed by Sheetal Nandi
parent 37a8e994f8
commit 1786d266d6
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -18,6 +18,7 @@
// Jack Leigh <https://github.com/leighman>
// Keagan McClelland <https://github.com/CaptJakk>
// Tomas Szabo <https://github.com/deftomat>
// Bonggyun Lee <https://github.com/deptno>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -1489,6 +1490,7 @@ declare namespace R {
* Reasonable analog to SQL `select` statement.
*/
project<T, U>(props: ReadonlyArray<string>, objs: ReadonlyArray<T>): U[];
project<T, U>(props: ReadonlyArray<string>): (objs: ReadonlyArray<T>) => U[];
/**
* Returns a function that when supplied an object returns the indicated property of that object, if it exists.
+1
View File
@@ -1619,6 +1619,7 @@ class Rectangle {
const fred = {name: "Fred", age: 12, hair: "brown", grade: 7};
const kids = [abby, fred];
R.project(["name", "grade"], kids); // => [{name: 'Abby', grade: 2}, {name: 'Fred', grade: 7}]
R.project(["name", "grade"])(kids); // => [{name: 'Abby', grade: 2}, {name: 'Fred', grade: 7}]
};
() => {