From 81e531f9ad95adaaf59fbd6d5e9d6be775bb5d2e Mon Sep 17 00:00:00 2001 From: Ivan Ha Date: Sat, 16 Mar 2019 19:08:45 +0800 Subject: [PATCH] ramda: support R.__ in R.propOr --- types/ramda/index.d.ts | 2 ++ types/ramda/ramda-tests.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 1078d9a51a..f3dd54dbb5 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -2332,6 +2332,8 @@ declare namespace R { * If the given, non-null object has an own property with the specified name, returns the value of that property. * Otherwise returns the provided default value. */ + propOr(val: T, __: Placeholder, obj: U): (p: string) => V; + propOr(__: Placeholder, p: string, obj: U): (val: T) => V; propOr(val: T, p: string, obj: U): V; propOr(val: T, p: string): (obj: U) => V; propOr(val: T): (p: string, obj: U) => V; diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 6f88d82200..782a85a90b 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1967,6 +1967,8 @@ class Rectangle { const favoriteWithDefault = R.propOr("Ramda", "favoriteLibrary"); const s2 = favoriteWithDefault(alice); // => 'Ramda' + R.propOr('Ramda', R.__, alice)('name'); // => 'ALICE' + R.propOr(R.__, 'foo', alice)('default'); // => 'default' }; () => {