Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save pfftdammitchris/357f921d4e4363599a044fdbab7e6ce2 to your computer and use it in GitHub Desktop.
The Power of TypeScript's Satisfies Operator - snippet-21.ts
type Config = {
server: {
host: string
port: number
}
}
const config = {
server: {
host: 'localhost',
port: 3000,
},
} satisfies Config
// The nested 'host' is widened to 'string', not 'localhost'
config.server.host // Type: string (not 'localhost')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment