const struct = pipe(
Schema.struct({
a: Schema.string,
b: Schema.number
}),
Schema.message(() => `my error here`)
)
Schema.parse(struct)(`not the expected schema`)
// Expected a generic object, actual "not the expected schema"
const number = pipe(
Schema.number,
Schema.message(() => `my error here`)
)
Schema.parse(number)(`not the expected schema`)
// my error here
const struct = pipe(
Schema.struct({
a: Schema.string,
b: Schema.number
}),
Schema.message(() => `my error here`)
)
Schema.parse(struct)(`not the expected schema`)
// Expected a generic object, actual "not the expected schema"
const number = pipe(
Schema.number,
Schema.message(() => `my error here`)
)
Schema.parse(number)(`not the expected schema`)
// my error here