Skip to main content
PProfileMatch
← Path

TypeScript · TypeScript Narrowing, Utility Types and tsconfig.json Setup

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Profile editor: the wall of fields

Trick to keep in mind+3 XP

Read utility types inside-out: Omit drops first, then Partial relaxes

Omit<Profile, "id"> builds a type that has every property except id. Partial then makes all remaining properties optional, so an empty object is valid. An object literal that supplies a property the type does not have is flagged as an excess property.

Read it once, then a question tests whether the trick stuck.