as const and satisfies

as const freezes a literal value: read-only properties and the most precise types (literals, tuples). satisfies checks that a value conforms to a type without widening the inferred type. Together, they validate a configuration while keeping its exact values.

Example

const routes = { accueil: '/', profil: '/profil' } as const;
const cfg = { port: 3000 } satisfies { port: number };

Related concepts

The whole glossary