A
arktype12mo ago
kyoumei

out.summary returns only one error 2.0.0-dev.11

Hi, I am just wondering if I am using this correctly as I followed the new arktype tutorial I made the following schema and validated it However, it only gives me one error For example in the following:
const user = type({
name: 'string>10',
email: 'email'
});

const out = user({
name: 'test',
email: ''
});

if (out instanceof type.errors) {
console.log(out.summary);
} else {
console.log(out);
}
const user = type({
name: 'string>10',
email: 'email'
});

const out = user({
name: 'test',
email: ''
});

if (out instanceof type.errors) {
console.log(out.summary);
} else {
console.log(out);
}
It posts in out.summary, email must be a valid email (was ""), but I was expecting to get both: - name must be more than length 10 (was 4) and; - email must be a valid email (was "") Is this expected behaviour or have I done something incorrectly?
2 Replies
ssalbdivad
ssalbdivad12mo ago
There was a bug in 2.0.0-dev.11 that caused this. Try 2.0.0-dev.12 and let me know if you have better luck!
kyoumei
kyoumeiOP12mo ago
Just updated and all the errors are coming through now, thanks!

Did you find this page helpful?