Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Object.getOwnPropertyDescriptors definition #15280

Closed
wants to merge 1 commit into from
Closed

Add Object.getOwnPropertyDescriptors definition #15280

wants to merge 1 commit into from

Conversation

shvaikalesh
Copy link
Contributor

@shvaikalesh shvaikalesh commented Apr 19, 2017

No description provided.

@msftclas
Copy link

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

* Returns an object containing all own property descriptors 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.
*/
getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: PropertyDescriptor };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.getOwnPropertyDescriptors output (just like Object.keys) should not only be limitied to keyof. please see #12253 and #13971 for relevant discussion.

I would recommend using an index singature along with the mapped type.

Also consider using TypedPropertyDescriptor instead to get better type flow.

getOwnPropertyDescriptors<T>(o: T): {[P in keyof T]: TypedPropertyDescriptor<T[P]>} & { [x: string]: PropertyDescriptor };

@mhegazy
Copy link
Contributor

mhegazy commented May 22, 2017

@shvaikalesh are you still interested in pursuing this PR?

@mhegazy
Copy link
Contributor

mhegazy commented May 23, 2017

closing for now. feel free to reopen.

@mhegazy mhegazy closed this May 23, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants