const { type } = scope(
{},
{
pattern: {
message: (ctx) => {
// How can I detect here that its an email vs some other pattern?
console.log(ctx)
return "test1"
},
},
}
)
const form = type({
email: "string.email",
})
const out = form({
email: "bla.com",
})
if (out instanceof type.errors) {
console.log(out.message)
}
const { type } = scope(
{},
{
pattern: {
message: (ctx) => {
// How can I detect here that its an email vs some other pattern?
console.log(ctx)
return "test1"
},
},
}
)
const form = type({
email: "string.email",
})
const out = form({
email: "bla.com",
})
if (out instanceof type.errors) {
console.log(out.message)
}