Conditional Select in M2M findMany Type Inference
hey there, I'm adding a method that allows the user to either get a list of objects, and sometimes get related objects al well (members). it works fine function-wise - but for some reason, the addition of the ternary doesn't give me any type hints. I'd assume it'll add them conditionally...
Is this a bug? am I missing anything?
here is my code's paraphrase:
1 Reply
Typescript usually does a good job inferring types but in this case you might need to either annotate the type or wrap this code in a generic function from which the final type can be inferred