Created
November 7, 2021 11:49
-
-
Save obedparla/71aa775999bb4d91ad193d72f61202dc to your computer and use it in GitHub Desktop.
Correctly gets all Object.keys types for TypeScript (both keys and values types)
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
export const objectGetTypedKeys = Object.keys as <T extends object>( | |
obj: T | |
) => Array<keyof T>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment