Can a typescript type be used in a yup validation?
In yup you can:
yup.string().oneOf(['salami', 'tuna', 'cheese']);
In one of my components I have this type defined:
type toppings = 'salami' | 'tuna' | 'cheese';
Can I combine these two? I.e.:
type toppings = 'salami' | 'tuna' | 'cheese';
yup.string().oneOf(toppings); // <- how?