Add Object.getOwnPropertyDescriptors definition#15280
Closed
shvaikalesh wants to merge 1 commit intomicrosoft:masterfrom
shvaikalesh:patch-1
Closed
Add Object.getOwnPropertyDescriptors definition#15280shvaikalesh wants to merge 1 commit intomicrosoft:masterfrom shvaikalesh:patch-1
Object.getOwnPropertyDescriptors definition#15280shvaikalesh wants to merge 1 commit intomicrosoft:masterfrom
shvaikalesh:patch-1
Conversation
|
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. |
mhegazy
suggested changes
Apr 24, 2017
| * 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 }; |
Contributor
There was a problem hiding this comment.
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 };
Contributor
|
@shvaikalesh are you still interested in pursuing this PR? |
Contributor
|
closing for now. feel free to reopen. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.