mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
propEq with one argument returns a curried function (#22923)
This commit is contained in:
committed by
Wesley Wigham
parent
6af5b8d3a5
commit
2037b3b9ba
14
types/ramda/index.d.ts
vendored
14
types/ramda/index.d.ts
vendored
@@ -1487,14 +1487,12 @@ declare namespace R {
|
||||
* value according to strict equality (`===`). Most likely used to
|
||||
* filter a list.
|
||||
*/
|
||||
// propEq<T>(name: string, val: T, obj: {[index:string]: T}): boolean;
|
||||
// propEq<T>(name: string, val: T, obj: {[index:number]: T}): boolean;
|
||||
propEq<T>(name: string, val: T, obj: any): boolean;
|
||||
// propEq<T>(name: number, val: T, obj: any): boolean;
|
||||
propEq<T>(name: string, val: T): (obj: any) => boolean;
|
||||
// propEq<T>(name: number, val: T): (obj: any) => boolean;
|
||||
propEq(name: string): <T>(val: T, obj: any) => boolean;
|
||||
// propEq(name: number): <T>(val: T, obj: any) => boolean;
|
||||
propEq<T>(name: string | number, val: T, obj: any): boolean;
|
||||
propEq<T>(name: string | number, val: T): (obj: any) => boolean;
|
||||
propEq(name: string | number): {
|
||||
<T>(val: T, obj: any): boolean;
|
||||
<T>(val: T): (obj: any) => boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the specified object property is of the given type; false otherwise.
|
||||
|
||||
@@ -583,6 +583,13 @@ R.times(i, 5);
|
||||
R.filter(isFamous, users); // => [ user1 ]
|
||||
};
|
||||
|
||||
() => {
|
||||
const coll = [{ type: 'BUY' }, { type: 'SELL' }, { type: 'BUY' }];
|
||||
const typeIs = R.propEq('type');
|
||||
const isBuy = typeIs('BUY');
|
||||
R.filter(isBuy, coll); // [{ type: 'BUY' }, { type: 'BUY' }]
|
||||
};
|
||||
|
||||
() => {
|
||||
const xs: { [key: string]: string } = {a: "1", b: "0"};
|
||||
R.propEq("a", "1", xs); // => true
|
||||
|
||||
Reference in New Issue
Block a user