MSNCodeSNIPPETS← msncode.dev
snippets/typescript

Satisfies Operator (TS 4.9+)

Validate a type without widening it

typescripttypescripttypesatisfies
TYPESCRIPT
const config = { port: 3000 } satisfies Config;

More typescript snippets

Type Async Function Return

Properly type the return of an async function

Omit Keys from Object Type

Create a type with specific keys removed

Make All Fields Optional

Make every property of a type optional

Pick Specific Keys from Type

Create a type with only selected keys