Created
April 19, 2020 19:31
-
-
Save RodrigoNovais/d0da69e370fea48e2c6bc1c57bf50bc1 to your computer and use it in GitHub Desktop.
custom object has a key checker
This file contains 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 hasKey = <T>(object: T, key: keyof any): key is keyof T => key in object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment