Narrowing Response Types Based on Route in TypeScript Match Implementation
Can you "narrow" a Match? I have a
so my implementation is like this
Which is fine, the actual type in the handler though thinks that this can return 3 different types of response objects.
I'd like to be able to narrow based on the route I pass in, that it should know it can't return the other 2.
Match that matches on a value of routesso my implementation is like this
Which is fine, the actual type in the handler though thinks that this can return 3 different types of response objects.
I'd like to be able to narrow based on the route I pass in, that it should know it can't return the other 2.
