DevPath

Handle every API result variant

Mid · fluency · 20 min · runtime js-node

Brief

Given a discriminated union of API results, write a function that handles every variant and makes an unhandled case a compile-time error.

3 progressive hints are available in the editor.

Public checks

  • checks the discriminant — expected: switches on status