// input:
{
foo: 'string|min:5',
bar: 'number[]',
o: { type: 'object', props: { a: 'string|max:24' } }
}
// output:
{
foo: { type: 'string', min: 5 },
bar: { type: 'array', items: 'number' },
o: {
type: { type: 'object' },
props: { a: { type: 'string', max: 24 } }
}
}
// input:
{
array: [
{ foo: { type: 'string', min: 5 } },
{ bar: 'number[]' }
]
}
// output:
{
array: {
type: 'multi',
rules: [
{ foo: { type: { type: 'string' }, min: 5 } },
{ bar: { type: 'array', items: 'number' } }
]
}
}
// input:
{
foo: { type: 'string', min: 5 },
bar: { type: 'array', items: 'number' }
}
// output:
{
foo: { type: { type: 'string' }, min: 5 },
bar: { type: { type: 'array' }, items: { type: 'number' } }
}