Typed Utilities

Type the small utilities interviews ask for, from picking keys and returning results instead of throwing to typed event emitters and branded ids.

  1. 01

    Pick Keys from an Object, Typed

    • easy
    • Code
  2. 02

    Return a Result Instead of Throwing

    • easy
    • Code
  3. 03

    Handle Every Case of a Union

    • easy
    • Code
  4. 04

    Check Unknown Data with a Type Guard

    • easy
    • Code
  5. 05

    Cache a Function's Results, Keeping Its Types

    • medium
    • Code
  6. 06

    Group a List by a Computed Key

    • medium
    • Code
  7. 07

    Build a Typed Event Emitter

    • medium
    • Code
  8. 08

    Freeze Nested Data, Types Included

    • medium
    • Code
    • Pro
  9. 09

    Build a Query String from Typed Params

    • medium
    • Code
    • Pro
  10. 10

    Keep Two Kinds of ID from Mixing Up

    • hard
    • Code
    • Pro