Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save pfftdammitchris/466a5e8d507a3ee059ff38ae977a4f53 to your computer and use it in GitHub Desktop.
The Power of TypeScript's Satisfies Operator - snippet-2.ts
// No type annotation
const theme = {
primary: '#3b82f6',
secondary: '#10b981',
danger: '#ef4444',
}
// Great! TypeScript knows the exact keys and values
theme.primary // Type is '#3b82f6'
theme.primry // Error! Property 'primry' does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment