mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
committed by
Sheetal Nandi
parent
37a8e994f8
commit
1786d266d6
Vendored
+2
@@ -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.
|
||||
|
||||
@@ -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}]
|
||||
};
|
||||
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user