Seeking Pattern Matching Solution for Union Type in TypeScript
Hey all!
I have an issue I'm trying to solve, hoping someone can help. I have a union type without a common field and I'm trying to use pattern matching on it without modifying the type. Simplified example:
I haven't found a function yet along the lines of
I have an issue I'm trying to solve, hoping someone can help. I have a union type without a common field and I'm trying to use pattern matching on it without modifying the type. Simplified example:
I haven't found a function yet along the lines of
keyExists though. Is there one? Or a comparable approach I can use here?