const pipedType = type({foo: 'string', bar: 'number'}).pipe((t, ctx) => {
if (t.foo === 'foo') {
ctx.error({
data: 'foo',
expected: 'bar',
message: 'baz',
code: 'predicate',
path: ['foo']
});
return ctx.errors;
}
return t;
});
const pipedType = type({foo: 'string', bar: 'number'}).pipe((t, ctx) => {
if (t.foo === 'foo') {
ctx.error({
data: 'foo',
expected: 'bar',
message: 'baz',
code: 'predicate',
path: ['foo']
});
return ctx.errors;
}
return t;
});