Welcome
TIL: TypeScript satisfies operator.md
All Notes
notes/til:-typescript-satisfies-oper

TIL: TypeScript satisfies operator

| notes

The satisfies operator validates types without widening.

const colors = {
  red: '#ff0000',
  green: '#00ff00',
} satisfies Record<string, string>;

// colors.red is still string, not string | undefined

Better than as const when you need validation without narrowing.