Koskamo

The satisfies operator

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

TypeScript 4.9 introduced the satisfies operator, which validates that the type of an expression matches some type without changing the resulting type of that expression. It resolves a common dilemma: you want to ensure an expression matches a type but also keep the most specific type of that expression for inference. Annotating a palette object as Record<Colors, string | RGB> catches a mistyped key like bleu, but each property then has the annotated union type, so palette.green.toUpperCase() errors because the property could be an RGB tuple; writing the object literal with satisfies Record<Colors, string | RGB> still catches the typo while toUpperCase() remains accessible. satisfies can also ensure that an object has all the keys of some type but no more — the release notes' favoriteColors example errors on an extra platypus key while retaining the per-property types — and can ensure that all of an object's property values conform to some type. Scope: TypeScript 4.9 and later. Reviewed October 4, 2026.

Source and provenance

Original source
www.typescriptlang.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.