mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Feature/43320 take two (#44989)
* #43320: typing for R.paths (correction) * #43320: tests for the cases that return `[undefined]`` Co-authored-by: Petr Motejlek <pmotejle@akamai.com>
This commit is contained in:
parent
336f38bc44
commit
6efb01d500
4
types/ramda/index.d.ts
vendored
4
types/ramda/index.d.ts
vendored
@ -1373,8 +1373,8 @@ export function pathOr<T>(defaultValue: T): _.F.Curry<(a: Path, b: any) => T>;
|
||||
/**
|
||||
* Retrieves the values at given paths of an object.
|
||||
*/
|
||||
export function paths<T>(paths: Path[], obj: any): T[] | undefined;
|
||||
export function paths<T>(paths: Path[]): (obj: any) => T[] | undefined;
|
||||
export function paths<T>(paths: Path[], obj: any): Array<T|undefined>;
|
||||
export function paths<T>(paths: Path[]): (obj: any) => Array<T|undefined>;
|
||||
|
||||
/**
|
||||
* Returns true if the specified object property at given path satisfies the given predicate; false otherwise.
|
||||
|
||||
@ -6,4 +6,7 @@ import * as R from 'ramda';
|
||||
|
||||
R.paths([['a', 'b'], ['p', 'r']], {a: {b: 2}, p: [{q: 3}]}); // => [2, undefined]
|
||||
R.paths([['a', 'b'], ['p', 'r']])({a: {b: 2}, p: [{q: 3}]}); // => [2, undefined]
|
||||
|
||||
R.paths([['thisKeyIsNotThere']], {}); // => [undefined]
|
||||
R.paths([['thisKeyIsNotThere']])({}); // => [undefined]
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user