Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save pfftdammitchris/ad6bd9e1765a636a03841b3fe64e2f88 to your computer and use it in GitHub Desktop.
The Power of TypeScript's Satisfies Operator - snippet-5.ts
// Contract is explicit - great for function parameters and return types
function createUser(data: UserInput): User {
// ...
}
// But for objects, it widens the type
const config: Config = { timeout: 5000 }
// config.timeout is now just `number`, not `5000`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment