Add stricter parameter types for Object.values and Object.entries (#20553)

* Add stricter parameter types for Object.values and Object.entries

* Use mapped type and constrain 'T extends object'

* Revert everything but change to parameter types
This commit is contained in:
Andy
2018-01-08 15:33:33 -08:00
committed by Mohamed Hegazy
parent 2869657da7
commit 39dfeb0176
6 changed files with 36 additions and 36 deletions

View File

@@ -9,7 +9,7 @@ interface ObjectConstructor {
* Returns an array of values of the enumerable properties of an object
* @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.
*/
values(o: any): any[];
values(o: {}): any[];
/**
* Returns an array of key/values of the enumerable properties of an object
@@ -21,7 +21,7 @@ interface ObjectConstructor {
* Returns an array of key/values of the enumerable properties of an object
* @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.
*/
entries(o: any): [string, any][];
entries(o: {}): [string, any][];
/**
* Returns an object containing all own property descriptors of an object