User-defined type guards

function isCustomer(partner: any): partner is Customer {
    return partner instanceof Customer;
}