mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-07 18:50:14 +00:00
ramda: support R.__ in R.propOr
This commit is contained in:
2
types/ramda/index.d.ts
vendored
2
types/ramda/index.d.ts
vendored
@@ -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<T, U>(val: T, __: Placeholder, obj: U): <V>(p: string) => V;
|
||||
propOr<U>(__: Placeholder, p: string, obj: U): <T, V>(val: T) => V;
|
||||
propOr<T, U, V>(val: T, p: string, obj: U): V;
|
||||
propOr<T>(val: T, p: string): <U, V>(obj: U) => V;
|
||||
propOr<T>(val: T): <U, V>(p: string, obj: U) => V;
|
||||
|
||||
@@ -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'
|
||||
};
|
||||
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user