Skip to content

Commit 61ec3be

Browse files
authored
Version 1.0.24 (#1379)
* Use TLocalizedValidationError on Assert * ChangeLog * Version
1 parent dfed596 commit 61ec3be

6 files changed

Lines changed: 14 additions & 8 deletions

File tree

changelog/1.0.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
---
44

55
### Version Updates
6-
6+
- [Revision 1.0.24](https://github.com/sinclairzx81/typebox/pull/1379)
7+
- Use TLocalizedValidationError on AssertError
78
- [Revision 1.0.23](https://github.com/sinclairzx81/typebox/pull/1378)
89
- Revert Standard Schema Error Path Translation | Provide Translation Via Example
910
- [Revision 1.0.22](https://github.com/sinclairzx81/typebox/pull/1375)

src/value/assert/assert.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ THE SOFTWARE.
2626
2727
---------------------------------------------------------------------------*/
2828

29-
import type { Static, TProperties, TSchema } from '../../type/index.ts'
3029
import { Arguments } from '../../system/arguments/index.ts'
30+
import type { TLocalizedValidationError } from '../../error/index.ts'
31+
import type { Static, TProperties, TSchema } from '../../type/index.ts'
32+
3133
import { Check } from '../check/index.ts'
3234
import { Errors } from '../errors/index.ts'
3335

3436
// ------------------------------------------------------------------
3537
// AssertError
3638
// ------------------------------------------------------------------
3739
export class AssertError extends Error {
38-
declare readonly cause: { source: string; errors: object[]; value: unknown }
39-
constructor(source: string, value: unknown, errors: object[]) {
40+
declare readonly cause: { source: string; errors: TLocalizedValidationError[]; value: unknown }
41+
constructor(source: string, value: unknown, errors: TLocalizedValidationError[]) {
4042
super(source)
4143
Object.defineProperty(this, 'cause', {
4244
value: { source, errors, value },

src/value/codec/decode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ THE SOFTWARE.
2929
// deno-fmt-ignore-file
3030

3131
import { Arguments } from '../../system/arguments/index.ts'
32+
import { type TLocalizedValidationError } from '../../error/errors.ts'
3233
import { type TProperties, type TSchema, type StaticDecode } from '../../type/index.ts'
3334

3435
import { AssertError } from '../assert/index.ts'
@@ -45,7 +46,7 @@ import { FromType } from './from-type.ts'
4546
// Assert
4647
// ------------------------------------------------------------------
4748
export class DecodeError extends AssertError {
48-
constructor(value: unknown, errors: object[]) {
49+
constructor(value: unknown, errors: TLocalizedValidationError[]) {
4950
super('Decode', value, errors)
5051
}
5152
}

src/value/codec/encode.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ THE SOFTWARE.
2929
// deno-fmt-ignore-file
3030

3131
import { Arguments } from '../../system/arguments/index.ts'
32+
import { type TLocalizedValidationError } from '../../error/errors.ts'
3233
import { type TProperties, type TSchema, type StaticEncode } from '../../type/index.ts'
3334

3435
import { AssertError } from '../assert/index.ts'
@@ -45,7 +46,7 @@ import { FromType } from './from-type.ts'
4546
// Assert
4647
// ------------------------------------------------------------------
4748
export class EncodeError extends AssertError {
48-
constructor(value: unknown, errors: object[]) {
49+
constructor(value: unknown, errors: TLocalizedValidationError[]) {
4950
super('Encode', value, errors)
5051
}
5152
}

src/value/parse/parse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ THE SOFTWARE.
2929
// deno-fmt-ignore-file
3030

3131
import { Arguments } from '../../system/arguments/index.ts'
32+
import { type TLocalizedValidationError } from '../../error/errors.ts'
3233
import { type TProperties, type TSchema, type StaticParse } from '../../type/index.ts'
3334

3435
import { AssertError } from '../assert/index.ts'
@@ -44,7 +45,7 @@ import { Pipeline } from '../pipeline/index.ts'
4445
// Assert
4546
// ------------------------------------------------------------------
4647
export class ParseError extends AssertError {
47-
constructor(value: unknown, errors: object[]) {
48+
constructor(value: unknown, errors: TLocalizedValidationError[]) {
4849
super('Parse', value, errors)
4950
}
5051
}

tasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Range } from './task/range/index.ts'
88
import { Metrics } from './task/metrics/index.ts'
99
import { Task } from 'tasksmith'
1010

11-
const Version = '1.0.23'
11+
const Version = '1.0.24'
1212

1313
// ------------------------------------------------------------------
1414
// Build

0 commit comments

Comments
 (0)