Use indexOf to check each type in hasType