How can I properly infer the return type based on a function that has one parameter that is a union of two types?
I\'ve tried the following with conditional types, bu