Probably a duplicate, but I cannot find one.
functionfoo(p1: string): void;functionfoo(p1: number,p2: boolean): void;functionfoo(p1,p2){// p1: string | number;// p2: boolean | undefined;}If there could be constraints among parameters via type guards, it would be awesome.
Probably a duplicate, but I cannot find one.
If there could be constraints among parameters via type guards, it would be awesome.