Skip to content

Instantly share code, notes, and snippets.

@pfftdammitchris
Created January 16, 2026 04:24
Show Gist options
  • Select an option

  • Save pfftdammitchris/30c1e9081dedf06fda71befe17c8cb58 to your computer and use it in GitHub Desktop.

Select an option

Save pfftdammitchris/30c1e9081dedf06fda71befe17c8cb58 to your computer and use it in GitHub Desktop.
The Power of TypeScript's Satisfies Operator - snippet-10.ts
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