function isFish(pet: Fish | Bird): pet is Fish {
return (<Fish>pet).swim !== undefined;
}
tells typescript that pet type is Fish
Is there a way to state the contrary, that the input parameter is NOT a Fish?
function isNotFish(pet: Fish | Bird): pet is not Fish { // ????
return pet.swim === undefined;
}