import { object, string, number, InferType } from "yup"; export const reviewSchema = object({ username: string().required(), rating: number().positive().max(5).test( "maxDigitsAfterDecimal", "Rating must have at most 1 decimal place", number => Number.isInteger(number! * 10) ).required(), content: string(), }); export type Review = InferType;