Skip to content

Commit 66d9b69

Browse files
committed
Object.keys: more precise types
Applying the same logic used on Object.entries in the prior commit and in microsoft#12207
1 parent 4e8f5ee commit 66d9b69

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/lib/es5.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ interface ObjectConstructor {
210210
* Returns the names of the enumerable properties and methods of an object.
211211
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
212212
*/
213+
keys<T>(o: Array<T>): string[];
214+
keys<T extends { [key: string]: any }>(o: T): (keyof T & string)[];
213215
keys(o: any): string[];
214216
}
215217

0 commit comments

Comments
 (0)