Open
Description
I want to generate a verification object from a serialized object, for example, the following input (which may not be described completely or accurately):
{
"name": {
"type": "string",
"minLength": 2
},
"age": {
"type": "number",
"minValue": 10
},
...
}
generate a validator with the same effect as the following rules:
v.object({
name: v.pipe(v.string(), v.minLength(2)),
age: v.pipe(v.number(), v.minValue(10)),
email: v.pipe(
v.string(),
v.minLength(5),
v.email(),
v.endsWith('@example.com')
)
})