Created
January 9, 2023 06:19
-
-
Save RodrigoNovais/616c36de1dee83a89da59a2329e768e5 to your computer and use it in GitHub Desktop.
Make properties optional in TypeScript
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 type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment