Skip to content

Commit 22b3aa7

Browse files
authored
Version 1.1.25 (#1577)
* Optimize Inference on Schema * ChangeLog * Version
1 parent 60debe0 commit 22b3aa7

5 files changed

Lines changed: 12 additions & 11 deletions

File tree

changelog/1.1.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
---
44

55
### Version Updates
6+
- [Revision 1.1.25](https://github.com/sinclairzx81/typebox/pull/1577)
7+
- Optimize Native Schema Inference via Type Static
68
- [Revision 1.1.24](https://github.com/sinclairzx81/typebox/pull/1576)
79
- Support DynamicRef and DynamicAnchor
810
- [Revision 1.1.23](https://github.com/sinclairzx81/typebox/pull/1575)

src/schema/check.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,16 @@ THE SOFTWARE.
3030
// deno-lint-ignore-file
3131

3232
import { Arguments } from '../system/arguments/index.ts'
33+
import { type Static } from '../type/types/static.ts'
3334
import * as Engine from './engine/index.ts'
3435
import * as Schema from './types/index.ts'
35-
import * as Static from './static/index.ts'
36-
3736
// ------------------------------------------------------------------
3837
// Check
3938
// ------------------------------------------------------------------
4039
/** Checks a value against the provided schema */
41-
export function Check<const Schema extends Schema.XSchema>(schema: Schema, value: unknown): value is Static.XStatic<Schema>
40+
export function Check<const Schema extends Schema.XSchema>(schema: Schema, value: unknown): value is Static<Schema>
4241
/** Checks a value against the provided schema */
43-
export function Check<const Schema extends Schema.XSchema>(context: Record<PropertyKey, Schema.XSchema>, schema: Schema, value: unknown): value is Static.XStatic<Schema>
42+
export function Check<const Schema extends Schema.XSchema>(context: Record<PropertyKey, Schema.XSchema>, schema: Schema, value: unknown): value is Static<Schema>
4443
/** Checks a value against the provided schema */
4544
export function Check(...args: unknown[]): boolean {
4645
const [context, schema, value] = Arguments.Match<[Record<PropertyKey, Schema.XSchema>, Schema.XSchema, unknown]>(args, {

src/schema/compile.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ THE SOFTWARE.
3131

3232
import { Arguments } from '../system/arguments/index.ts'
3333
import { type TLocalizedValidationError } from '../error/index.ts'
34+
import { type Static } from '../type/types/static.ts'
3435
import * as Build from './build.ts'
3536
import * as Schema from './types/index.ts'
36-
import * as Static from './static/index.ts'
3737
import { Errors } from './errors.ts'
3838
import { ParseError } from './parse.ts'
3939

4040
// ------------------------------------------------------------------
4141
// Validator
4242
// ------------------------------------------------------------------
43-
export class Validator<Schema extends Schema.XSchema = Schema.XSchema,
44-
Value extends unknown = Static.XStatic<Schema>
43+
export class Validator<const Schema extends Schema.XSchema = Schema.XSchema,
44+
Value extends unknown = Static<Schema>
4545
> {
4646
private readonly build: Build.BuildResult
4747
private readonly result: Build.EvaluateResult

src/schema/parse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ THE SOFTWARE.
3131

3232
import { Arguments } from '../system/arguments/index.ts'
3333
import { type TLocalizedValidationError } from '../error/index.ts'
34+
import { type Static } from '../type/types/static.ts'
3435
import { Check } from './check.ts'
3536
import { Errors } from './errors.ts'
3637
import * as Schema from './types/index.ts'
37-
import * as Static from './static/index.ts'
3838

3939
// ------------------------------------------------------------------
4040
// ParseError
@@ -50,9 +50,9 @@ export class ParseError {
5050
// Parse
5151
// ------------------------------------------------------------------
5252
/** Parses a value against the provided schema */
53-
export function Parse<const Schema extends Schema.XSchema>(schema: Schema, value: unknown): Static.XStatic<Schema>
53+
export function Parse<const Schema extends Schema.XSchema>(schema: Schema, value: unknown): Static<Schema>
5454
/** Parses a value against the provided schema */
55-
export function Parse<const Schema extends Schema.XSchema>(context: Record<PropertyKey, Schema.XSchema>, schema: Schema, value: unknown): Static.XStatic<Schema>
55+
export function Parse<const Schema extends Schema.XSchema>(context: Record<PropertyKey, Schema.XSchema>, schema: Schema, value: unknown): Static<Schema>
5656
/** Parses a value against the provided schema */
5757
export function Parse(...args: unknown[]): unknown {
5858
const [context, schema, value] = Arguments.Match<[Record<PropertyKey, Schema.XSchema>, Schema.XSchema, unknown]>(args, {

tasks.ts

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

12-
const Version = '1.1.24'
12+
const Version = '1.1.25'
1313

1414
// ------------------------------------------------------------------
1515
// Build

0 commit comments

Comments
 (0)