export type Topping = "tapioca" | "grass_jelly" | "aloe_vera" | "red_bean" | "pudding" ; export const toppings = [ "tapioca" , "grass_jelly" , "aloe_vera" , "red_bean" , "pudding" ] ; export const isTopping = ( topping ) : topping is Topping => { return ( typeof topping === "string" && toppings . indexOf ( topping as Topping ) >= 0 ) ; } ;