Today I’m sharing a little trick that I like to use to make switch statements cleaner and more type-safe. Happy to hear other ideas!

  • dracs@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 months ago

    I haven’t had a chance to try it myself yet. I saw someone give a recommendation for ts-pattern which provides functions for pattern matching with optional exhaustion.