GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — Add `Object.getOwnPropertyDescriptors` definition by shvaikalesh · Pull Request #15280 · microsoft/TypeScript 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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * 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 }; |
There was a problem 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 };
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Alexey Shvaika (@shvaikalesh) are you still interested in pursuing this PR? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
closing for now. feel free to reopen. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.