Skip to content

Commit

Permalink
Union Error Emit Order (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 authored Apr 10, 2023
1 parent 691c24b commit 39fccd5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sinclair/typebox",
"version": "0.27.1",
"version": "0.27.2",
"description": "JSONSchema Type Builder with Static Type Resolution for TypeScript",
"keywords": [
"typescript",
Expand Down
6 changes: 3 additions & 3 deletions src/errors/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,12 +490,12 @@ export namespace ValueErrors {
if (variantErrors.length === 0) return
errors.push(...variantErrors)
}
for (const error of errors) {
yield error
}
if (errors.length > 0) {
yield { type: ValueErrorType.Union, schema, path, value, message: 'Expected value of union' }
}
for (const error of errors) {
yield error
}
}
function* Uint8Array(schema: Types.TUint8Array, references: Types.TSchema[], path: string, value: any): IterableIterator<ValueError> {
if (!(value instanceof globalThis.Uint8Array)) {
Expand Down

0 comments on commit 39fccd5

Please sign in to comment.