mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 13:30:28 +00:00
Merge pull request #19227 from psachs21/master
Ramda: Values<T> should not resolve as {}[], instead it should resolve to T[]
This commit is contained in:
Vendored
+1
-1
@@ -1917,7 +1917,7 @@ declare namespace R {
|
||||
* Note that the order of the output array is not guaranteed across
|
||||
* different JS platforms.
|
||||
*/
|
||||
values<T>(obj: { [index: string]: T } | any): T[];
|
||||
values<T extends object, K extends keyof T>(obj: T): Array<T[K]>;
|
||||
|
||||
/**
|
||||
* Returns a list of all the properties, including prototype properties, of the supplied
|
||||
|
||||
@@ -1567,7 +1567,19 @@ class Rectangle {
|
||||
};
|
||||
|
||||
() => {
|
||||
const a = R.values({a: 1, b: 2, c: 3}); // => [1, 2, 3]
|
||||
interface A {
|
||||
a: string;
|
||||
b: string;
|
||||
}
|
||||
const a1: A = { a: 'something', b: 'else' };
|
||||
const v1 = R.values(a1);
|
||||
|
||||
const a = R.values({a: 1, b: 2, c: 3}); // => [1, 2, 3] (number[])
|
||||
const addition = a[0] + a[1];
|
||||
|
||||
const b = R.values({a: 1, b: 'something'}); // b = (string|number)[]
|
||||
const c = R.values({1: 3});
|
||||
// const d = R.values('something');
|
||||
};
|
||||
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user