satisfies Operator (TS 4.9)
TL;DR
satisfies validates that a value matches a type without widening the inferred type — keeping precise literal types while checking against an interface.
Explanation
Before satisfies, you had to choose: use 'as Type' (loses inference) or rely on inference (no type safety). satisfies validates the shape without widening. Example: const palette = { red: [255,0,0], green: '#00ff00' } satisfies Record<string, string | number[]> — TypeScript knows palette.red is number[] (not string | number[]) because inference is preserved. This enables calling .toUpperCase() on palette.green without a type assertion, while still checking it conforms to the Record type. Useful for config objects, CSS-in-JS, and any case where you want validation without losing specificity.
Common Misconception
✗ satisfies is the same as 'as' type assertion — 'as' forces a type and can hide errors. satisfies validates without widening.
Why It Matters
satisfies allows type-safe config objects and large data structures where you want both validation and precise property types — previously impossible without redundancy.
Common Mistakes
- Using 'as Type' when satisfies is more appropriate — 'as' silences errors.
- Using satisfies without understanding it preserves inferred types for each property.
- Expecting satisfies to change the runtime behaviour — it's compile-time only.
Code Examples
✗ Vulnerable
// As-assertion loses specificity:
const config = {
timeout: 5000,
endpoint: '/api'
} as Config; // config.timeout is now Config['timeout'], not 5000
✓ Fixed
type Config = { timeout: number; endpoint: string };
const config = {
timeout: 5000, // TypeScript knows this is 5000, not just number
endpoint: '/api' // TypeScript knows this is '/api', not just string
} satisfies Config;
config.timeout; // type: 5000 (literal) — not number
Tags
🤝 Adopt this term
£79/year · your link shown here
Added
22 Mar 2026
Views
26
🤖 AI Guestbook educational data only
|
|
Last 30 days
Agents 0
No pings yet today
No pings yesterday
Amazonbot 12
Unknown AI 3
Google 3
Ahrefs 3
Perplexity 2
ChatGPT 1
Meta AI 1
How they use it
crawler 22
crawler_json 1
pre-tracking 2
Related categories
⚡
DEV INTEL
Tools & Severity
🔵 Info
⚙ Fix effort: Low
⚡ Quick Fix
Replace 'as Type' for config objects with 'satisfies Type' to preserve literal types while validating shape.
📦 Applies To
typescript 4.9
web
cli
🔗 Prerequisites
🔍 Detection Hints
satisfies
Auto-detectable:
✗ No
typescript
🤖 AI Agent
Confidence: Low
False Positives: Medium
✓ Auto-fixable
Fix: Low
Context: Line