Created
January 16, 2026 04:24
-
-
Save pfftdammitchris/30c1e9081dedf06fda71befe17c8cb58 to your computer and use it in GitHub Desktop.
The Power of TypeScript's Satisfies Operator - snippet-10.ts
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
| type Features = 'darkMode' | 'notifications' | 'analytics' | |
| const featureFlags = { | |
| darkMode: true, | |
| notifications: false, | |
| analytics: true, | |
| } satisfies Record<Features, boolean> | |
| // If you add a new feature to the union and forget to add it here, | |
| // TypeScript will error! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment