After a year of being on sabbatical (that’s fancy-talk for unemployed), I recently joined Salto’s engineering team and started learning TypeScript. Salto allows business application admins to use DevOps methodlogies when managing their configuration. One of the cool things about them is that their core business logic is open source. As part of that OSS repo, there’s a standalone library called lowerdash, where I found they have a nifty little type called OneOf
to express mutually-exclusive properties. Here’s an example:
This is a companion discussion topic for the original entry at https://amir.rachum.com/typescript-oneof