npm i valts
Definge your schema using valts
import {Obj,Validate} from "valts";
let schema=Obj({
name: { type: "string" },
email: { type: "string", email: [true, "Invalid Email"] },
});
let validate=Validate(schema,{name:"ameen",email:"amee@gma.com"})