From 1786d266d6d1c64dc3fca9eeab8e3fd3f5d45c83 Mon Sep 17 00:00:00 2001 From: Bonggyun Lee Date: Thu, 10 May 2018 03:40:44 +0900 Subject: [PATCH] add R.project curry definition (#25635) * fix R.project curry * mend --- types/ramda/index.d.ts | 2 ++ types/ramda/ramda-tests.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 8ef80d60e1..7301b28aae 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -18,6 +18,7 @@ // Jack Leigh // Keagan McClelland // Tomas Szabo +// Bonggyun Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -1489,6 +1490,7 @@ declare namespace R { * Reasonable analog to SQL `select` statement. */ project(props: ReadonlyArray, objs: ReadonlyArray): U[]; + project(props: ReadonlyArray): (objs: ReadonlyArray) => U[]; /** * Returns a function that when supplied an object returns the indicated property of that object, if it exists. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 0133f82e95..8cbbf9ceac 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -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}] }; () => {