Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save pfftdammitchris/ec5cb1ca281da7dadd0c1d7a1c3be8c0 to your computer and use it in GitHub Desktop.
The Power of TypeScript's Satisfies Operator - snippet-24.ts
// After: satisfies preserves literal types
const theme = {
primary: '#3b82f6',
secondary: '#10b981',
} satisfies Record<string, string>
// No more unnecessary type guards!
theme.primary // TypeScript knows this exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment