typebox 1.0.75 → 1.0.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/type/engine/evaluate/distribute.d.mts +1 -10
- package/build/type/engine/evaluate/distribute.mjs +2 -4
- package/build/type/engine/patterns/pattern.d.mts +3 -4
- package/build/type/engine/patterns/pattern.mjs +2 -4
- package/build/type/engine/record/from-key-template-literal.d.mts +2 -2
- package/build/type/engine/record/from-key-template-literal.mjs +2 -2
- package/build/type/engine/template-literal/decode.d.mts +16 -6
- package/build/type/engine/template-literal/decode.mjs +23 -9
- package/build/type/engine/template-literal/index.d.mts +2 -1
- package/build/type/engine/template-literal/index.mjs +2 -1
- package/build/type/engine/template-literal/{finite.d.mts → is-finite.d.mts} +2 -2
- package/build/type/engine/template-literal/{finite.mjs → is-finite.mjs} +1 -1
- package/build/type/engine/template-literal/is-pattern.d.mts +6 -0
- package/build/type/engine/template-literal/is-pattern.mjs +9 -0
- package/build/type/types/record.d.mts +2 -1
- package/build/type/types/record.mjs +5 -3
- package/package.json +1 -1
- package/readme.md +2 -2
|
@@ -7,16 +7,7 @@ import { type TNarrow } from './narrow.mjs';
|
|
|
7
7
|
import { type TEvaluateType } from './evaluate.mjs';
|
|
8
8
|
import { type TEvaluateIntersect } from './evaluate.mjs';
|
|
9
9
|
type TIsObjectLike<Type extends TSchema> = Type extends TObject | TTuple ? true : false;
|
|
10
|
-
type TIsUnionOperand<Left extends TSchema, Right extends TSchema, IsUnionLeft extends boolean = Left extends TUnion ? true : false, IsUnionRight extends boolean = Right extends TUnion ? true : false, Result extends boolean =
|
|
11
|
-
IsUnionLeft,
|
|
12
|
-
IsUnionRight
|
|
13
|
-
] extends [true, true] ? true : [
|
|
14
|
-
IsUnionLeft,
|
|
15
|
-
IsUnionRight
|
|
16
|
-
] extends [false, true] ? true : [
|
|
17
|
-
IsUnionLeft,
|
|
18
|
-
IsUnionRight
|
|
19
|
-
] extends [true, false] ? true : false)> = Result;
|
|
10
|
+
type TIsUnionOperand<Left extends TSchema, Right extends TSchema, IsUnionLeft extends boolean = Left extends TUnion ? true : false, IsUnionRight extends boolean = Right extends TUnion ? true : false, Result extends boolean = IsUnionLeft extends true ? true : IsUnionRight extends true ? true : false> = Result;
|
|
20
11
|
type TDistributeOperation<Left extends TSchema, Right extends TSchema, EvaluatedLeft extends TSchema = TEvaluateType<Left>, EvaluatedRight extends TSchema = TEvaluateType<Right>, IsUnionOperand extends boolean = TIsUnionOperand<EvaluatedLeft, EvaluatedRight>, IsObjectLeft extends boolean = TIsObjectLike<EvaluatedLeft>, IsObjectRight extends boolean = TIsObjectLike<EvaluatedRight>, Result extends TSchema = ([
|
|
21
12
|
IsUnionOperand
|
|
22
13
|
] extends [true] ? TEvaluateIntersect<[EvaluatedLeft, EvaluatedRight]> : [
|
|
@@ -15,10 +15,8 @@ function IsObjectLike(type) {
|
|
|
15
15
|
function IsUnionOperand(left, right) {
|
|
16
16
|
const isUnionLeft = IsUnion(left);
|
|
17
17
|
const isUnionRight = IsUnion(right);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
isUnionLeft && !isUnionRight ? true :
|
|
21
|
-
false);
|
|
18
|
+
const result = isUnionLeft || isUnionRight;
|
|
19
|
+
return result;
|
|
22
20
|
}
|
|
23
21
|
function DistributeOperation(left, right) {
|
|
24
22
|
const evaluatedLeft = EvaluateType(left);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { type TUnreachable } from '../../../system/unreachable/index.mjs';
|
|
2
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
3
2
|
import { type TPattern } from '../../script/parser.mjs';
|
|
4
|
-
/** Parses a Pattern into a sequence of TemplateLiteral types */
|
|
5
|
-
export type TParsePatternIntoTypes<Pattern extends string, Parsed extends [TSchema[], string] | [] = TPattern<Pattern>, Result extends TSchema[] = Parsed extends [infer Types extends TSchema[], string] ? Types :
|
|
6
|
-
/** Parses a Pattern into a sequence of TemplateLiteral types */
|
|
3
|
+
/** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
|
|
4
|
+
export type TParsePatternIntoTypes<Pattern extends string, Parsed extends [TSchema[], string] | [] = TPattern<Pattern>, Result extends TSchema[] = Parsed extends [infer Types extends TSchema[], string] ? Types : []> = Result;
|
|
5
|
+
/** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
|
|
7
6
|
export declare function ParsePatternIntoTypes<Pattern extends string>(pattern: Pattern): TParsePatternIntoTypes<Pattern>;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
|
-
import { Unreachable } from '../../../system/unreachable/index.mjs';
|
|
3
2
|
import { Guard } from '../../../guard/index.mjs';
|
|
4
3
|
import { Pattern } from '../../script/parser.mjs';
|
|
5
|
-
/** Parses a Pattern into a sequence of TemplateLiteral types */
|
|
4
|
+
/** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
|
|
6
5
|
export function ParsePatternIntoTypes(pattern) {
|
|
7
6
|
const parsed = Pattern(pattern);
|
|
8
7
|
const result = Guard.IsEqual(parsed.length, 2)
|
|
9
8
|
? parsed[0]
|
|
10
|
-
:
|
|
9
|
+
: []; // Failed to Parse
|
|
11
10
|
return result;
|
|
12
11
|
}
|
|
13
|
-
// deno-coverage-ignore-stop
|
|
@@ -2,7 +2,7 @@ import { type TSchema } from '../../types/schema.mjs';
|
|
|
2
2
|
import { type TRecord } from '../../types/record.mjs';
|
|
3
3
|
import { type TFromKey } from './from-key.mjs';
|
|
4
4
|
import { type TParsePatternIntoTypes } from '../patterns/pattern.mjs';
|
|
5
|
-
import { type
|
|
5
|
+
import { type TIsTemplateLiteralFinite } from '../template-literal/is-finite.mjs';
|
|
6
6
|
import { type TTemplateLiteralDecode } from '../template-literal/decode.mjs';
|
|
7
|
-
export type TFromTemplateKey<Pattern extends string, Value extends TSchema, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Finite extends boolean =
|
|
7
|
+
export type TFromTemplateKey<Pattern extends string, Value extends TSchema, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Finite extends boolean = TIsTemplateLiteralFinite<Types>, Result extends TSchema = Finite extends true ? TFromKey<TTemplateLiteralDecode<Pattern>, Value> : TRecord<Pattern, Value>> = Result;
|
|
8
8
|
export declare function FromTemplateKey<Pattern extends string, Value extends TSchema>(pattern: Pattern, value: Value): TFromTemplateKey<Pattern, Value>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { FromKey } from './from-key.mjs';
|
|
3
3
|
import { ParsePatternIntoTypes } from '../patterns/pattern.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { IsTemplateLiteralFinite } from '../template-literal/is-finite.mjs';
|
|
5
5
|
import { TemplateLiteralDecode } from '../template-literal/decode.mjs';
|
|
6
6
|
import { CreateRecord } from './record-create.mjs';
|
|
7
7
|
export function FromTemplateKey(pattern, value) {
|
|
8
8
|
const types = ParsePatternIntoTypes(pattern);
|
|
9
|
-
const finite =
|
|
9
|
+
const finite = IsTemplateLiteralFinite(types);
|
|
10
10
|
const result = finite ? FromKey(TemplateLiteralDecode(pattern), value) : CreateRecord(pattern, value);
|
|
11
11
|
return result;
|
|
12
12
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { TUnreachable } from '../../../system/unreachable/index.mjs';
|
|
2
|
+
import { type TLiteral, type TLiteralValue } from '../../types/literal.mjs';
|
|
2
3
|
import { type TSchema } from '../../types/schema.mjs';
|
|
3
|
-
import { type TUnion } from '../../types/union.mjs';
|
|
4
4
|
import { type TString } from '../../types/string.mjs';
|
|
5
|
-
import { type
|
|
5
|
+
import { type TTemplateLiteral } from '../../types/template-literal.mjs';
|
|
6
|
+
import { type TUnion } from '../../types/union.mjs';
|
|
6
7
|
import { type TParsePatternIntoTypes } from '../patterns/pattern.mjs';
|
|
7
|
-
import { type
|
|
8
|
+
import { type TIsTemplateLiteralFinite } from './is-finite.mjs';
|
|
8
9
|
type TFromLiteralPush<Variants extends string[], Value extends TLiteralValue, Result extends string[] = []> = Variants extends [infer Left extends string, ...infer Right extends string[]] ? TFromLiteralPush<Right, Value, [...Result, `${Left}${Value}`]> : Result;
|
|
9
10
|
type TFromLiteral<Variants extends string[], Value extends TLiteralValue> = Variants extends [] ? [`${Value}`] : TFromLiteralPush<Variants, Value>;
|
|
10
11
|
type TFromUnion<Variants extends string[], Types extends TSchema[], Result extends string[] = []> = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion<Variants, Right, [...Result, ...TFromType<Variants, Left>]> : Result;
|
|
@@ -13,8 +14,17 @@ type TDecodeFromSpan<Variants extends string[], Types extends TSchema[]> = Types
|
|
|
13
14
|
type TVariantsToLiterals<Variants extends string[], Result extends TSchema[] = []> = Variants extends [infer Left extends string, ...infer Right extends string[]] ? TVariantsToLiterals<Right, [...Result, TLiteral<Left>]> : Result;
|
|
14
15
|
type TDecodeTypesAsUnion<Types extends TSchema[], Variants extends string[] = TDecodeFromSpan<[], Types>, Literals extends TSchema[] = TVariantsToLiterals<Variants>, Result extends TSchema = TUnion<Literals>> = Result;
|
|
15
16
|
type TDecodeTypes<Types extends TSchema[], Result extends TSchema = (Types extends [] ? TUnreachable : Types extends [infer Type extends TLiteral] ? Type : TDecodeTypesAsUnion<Types>)> = Result;
|
|
16
|
-
/** Decodes a TemplateLiteral into a Type.
|
|
17
|
-
export type
|
|
18
|
-
/**
|
|
17
|
+
/** Decodes a TemplateLiteral into a Type. */
|
|
18
|
+
export type TTemplateLiteralDecodeUnsafe<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Result extends TSchema = (Types extends [] ? TString : TIsTemplateLiteralFinite<Types> extends true ? TDecodeTypes<Types> : TTemplateLiteral<Pattern>)> = Result;
|
|
19
|
+
/**
|
|
20
|
+
* (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite
|
|
21
|
+
* TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this
|
|
22
|
+
* TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal
|
|
23
|
+
* decoding algorithm is needed. (for review)
|
|
24
|
+
*/
|
|
25
|
+
export declare function TemplateLiteralDecodeUnsafe<Pattern extends string>(pattern: Pattern): TTemplateLiteralDecodeUnsafe<Pattern>;
|
|
26
|
+
/** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
|
|
27
|
+
export type TTemplateLiteralDecode<Pattern extends string, Decoded extends TSchema = TTemplateLiteralDecodeUnsafe<Pattern>, Result extends TSchema = Decoded extends TTemplateLiteral ? TString : Decoded> = Result;
|
|
28
|
+
/** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
|
|
19
29
|
export declare function TemplateLiteralDecode<Pattern extends string>(pattern: Pattern): TTemplateLiteralDecode<Pattern>;
|
|
20
30
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Unreachable } from '../../../system/unreachable/index.mjs';
|
|
3
3
|
import { Guard } from '../../../guard/index.mjs';
|
|
4
|
+
import { Literal, IsLiteral } from '../../types/literal.mjs';
|
|
4
5
|
import { IsSchema } from '../../types/schema.mjs';
|
|
5
|
-
import { Union, IsUnion } from '../../types/union.mjs';
|
|
6
6
|
import { String } from '../../types/string.mjs';
|
|
7
|
-
import {
|
|
7
|
+
import { IsTemplateLiteral } from '../../types/template-literal.mjs';
|
|
8
|
+
import { Union, IsUnion } from '../../types/union.mjs';
|
|
8
9
|
import { ParsePatternIntoTypes } from '../patterns/pattern.mjs';
|
|
9
|
-
import {
|
|
10
|
+
import { IsTemplateLiteralFinite } from './is-finite.mjs';
|
|
11
|
+
import { TemplateLiteralCreate } from './create.mjs';
|
|
10
12
|
function FromLiteralPush(variants, value, result = []) {
|
|
11
13
|
const [left, ...right] = variants;
|
|
12
14
|
return (Guard.IsString(left) ? FromLiteralPush(right, value, [...result, `${left}${value}`]) : result);
|
|
@@ -62,12 +64,24 @@ function DecodeTypes(types) {
|
|
|
62
64
|
Guard.IsEqual(types.length, 1) && IsLiteral(types[0]) ? types[0] :
|
|
63
65
|
DecodeTypesAsUnion(types));
|
|
64
66
|
}
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
+
/**
|
|
68
|
+
* (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite
|
|
69
|
+
* TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this
|
|
70
|
+
* TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal
|
|
71
|
+
* decoding algorithm is needed. (for review)
|
|
72
|
+
*/
|
|
73
|
+
export function TemplateLiteralDecodeUnsafe(pattern) {
|
|
67
74
|
const types = ParsePatternIntoTypes(pattern);
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
const result = Guard.IsEqual(types.length, 0) // Failed to Parse | IsTemplateLiteralPattern
|
|
76
|
+
? String() // ... Pattern cannot be typed, so discard
|
|
77
|
+
: IsTemplateLiteralFinite(types)
|
|
78
|
+
? DecodeTypes(types)
|
|
79
|
+
: TemplateLiteralCreate(pattern);
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
/** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
|
|
83
|
+
export function TemplateLiteralDecode(pattern) {
|
|
84
|
+
const decoded = TemplateLiteralDecodeUnsafe(pattern);
|
|
85
|
+
const result = IsTemplateLiteral(decoded) ? String() : decoded;
|
|
72
86
|
return result;
|
|
73
87
|
}
|
|
@@ -6,7 +6,7 @@ type TFromTypesReduce<Types extends TSchema[]> = (Types extends [infer Left exte
|
|
|
6
6
|
type TFromTypes<Types extends TSchema[], Result extends boolean = Types extends [] ? false : TFromTypesReduce<Types>> = Result;
|
|
7
7
|
type TFromType<Type extends TSchema> = Type extends TUnion<infer Types extends TSchema[]> ? TFromTypes<Types> : Type extends TLiteral<infer Value extends TLiteralValue> ? TFromLiteral<Value> : false;
|
|
8
8
|
/** Returns true if the given TemplateLiteral types yields a finite variant set */
|
|
9
|
-
export type
|
|
9
|
+
export type TIsTemplateLiteralFinite<Types extends TSchema[], Result extends boolean = TFromTypes<Types>> = Result;
|
|
10
10
|
/** Returns true if the given TemplateLiteral types yields a finite variant set */
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function IsTemplateLiteralFinite<Types extends TSchema[]>(types: [...Types]): TIsTemplateLiteralFinite<Types>;
|
|
12
12
|
export {};
|
|
@@ -24,7 +24,7 @@ function FromType(type) {
|
|
|
24
24
|
false);
|
|
25
25
|
}
|
|
26
26
|
/** Returns true if the given TemplateLiteral types yields a finite variant set */
|
|
27
|
-
export function
|
|
27
|
+
export function IsTemplateLiteralFinite(types) {
|
|
28
28
|
const result = FromTypes(types);
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type TSchema } from '../../types/schema.mjs';
|
|
2
|
+
import { type TParsePatternIntoTypes } from '../patterns/pattern.mjs';
|
|
3
|
+
/** Returns true if this pattern is a valid Template Literal regular expression */
|
|
4
|
+
export type TIsTemplateLiteralPattern<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Result extends boolean = Types extends [] ? false : true> = Result;
|
|
5
|
+
/** Returns true if this pattern is a valid Template Literal regular expression */
|
|
6
|
+
export declare function IsTemplateLiteralPattern<Pattern extends string>(pattern: Pattern): TIsTemplateLiteralPattern<Pattern>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Guard } from '../../../guard/index.mjs';
|
|
3
|
+
import { ParsePatternIntoTypes } from '../patterns/pattern.mjs';
|
|
4
|
+
/** Returns true if this pattern is a valid Template Literal regular expression */
|
|
5
|
+
export function IsTemplateLiteralPattern(pattern) {
|
|
6
|
+
const types = ParsePatternIntoTypes(pattern);
|
|
7
|
+
const result = Guard.IsEqual(types.length, 0) ? false : true;
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
@@ -7,6 +7,7 @@ import { type TString } from './string.mjs';
|
|
|
7
7
|
import { type TDeferred } from './deferred.mjs';
|
|
8
8
|
import { type TInstantiate } from '../engine/instantiate.mjs';
|
|
9
9
|
import { type TTemplateLiteralStatic } from '../engine/template-literal/index.mjs';
|
|
10
|
+
import { type TTemplateLiteralDecodeUnsafe } from '../engine/template-literal/decode.mjs';
|
|
10
11
|
type StaticPropertyKey<Key extends string, Result extends PropertyKey = (Key extends TStringKey ? string : Key extends TIntegerKey ? number : Key extends TNumberKey ? number : Key extends `^${string}$` ? TTemplateLiteralStatic<Key> : string)> = Result;
|
|
11
12
|
export type StaticRecord<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Key extends string, Value extends TSchema, StaticKey extends PropertyKey = StaticPropertyKey<Key>, StaticValue extends unknown = StaticType<Stack, Direction, Context, This, Value>> = Record<StaticKey, StaticValue>;
|
|
12
13
|
export type TStringKey = typeof StringKey;
|
|
@@ -37,7 +38,7 @@ export type TRecordPattern<Type extends TRecord, Result extends string = Extract
|
|
|
37
38
|
/** Returns the raw string pattern used for the Record key */
|
|
38
39
|
export declare function RecordPattern<Type extends TRecord>(type: Type): TRecordPattern<Type>;
|
|
39
40
|
/** Returns the Record key as a TypeBox type */
|
|
40
|
-
export type TRecordKey<Type extends TRecord, Pattern extends string = TRecordPattern<Type>, Result extends TSchema = (Pattern extends typeof IntegerKey ? TInteger : Pattern extends typeof NumberKey ? TNumber :
|
|
41
|
+
export type TRecordKey<Type extends TRecord, Pattern extends string = TRecordPattern<Type>, Result extends TSchema = (Pattern extends typeof StringKey ? TString : Pattern extends typeof IntegerKey ? TInteger : Pattern extends typeof NumberKey ? TNumber : TTemplateLiteralDecodeUnsafe<Pattern>)> = Result;
|
|
41
42
|
/** Returns the Record key as a TypeBox type */
|
|
42
43
|
export declare function RecordKey<Type extends TRecord>(type: Type): TRecordKey<Type>;
|
|
43
44
|
export type TRecordValue<Type extends TRecord, Result extends TSchema = Type['patternProperties'][TRecordPattern<Type>]> = Result;
|
|
@@ -7,6 +7,7 @@ import { Number, NumberPattern } from './number.mjs';
|
|
|
7
7
|
import { String, StringPattern } from './string.mjs';
|
|
8
8
|
import { Deferred } from './deferred.mjs';
|
|
9
9
|
import { Instantiate } from '../engine/instantiate.mjs';
|
|
10
|
+
import { TemplateLiteralDecodeUnsafe } from '../engine/template-literal/decode.mjs';
|
|
10
11
|
import { CreateRecord } from '../engine/record/record-create.mjs';
|
|
11
12
|
export const IntegerKey = `^${IntegerPattern}$`;
|
|
12
13
|
export const NumberKey = `^${NumberPattern}$`;
|
|
@@ -39,9 +40,10 @@ export function RecordPattern(type) {
|
|
|
39
40
|
/** Returns the Record key as a TypeBox type */
|
|
40
41
|
export function RecordKey(type) {
|
|
41
42
|
const pattern = RecordPattern(type);
|
|
42
|
-
const result = (Guard.IsEqual(pattern,
|
|
43
|
-
Guard.IsEqual(pattern,
|
|
44
|
-
|
|
43
|
+
const result = (Guard.IsEqual(pattern, StringKey) ? String() :
|
|
44
|
+
Guard.IsEqual(pattern, IntegerKey) ? Integer() :
|
|
45
|
+
Guard.IsEqual(pattern, NumberKey) ? Number() :
|
|
46
|
+
TemplateLiteralDecodeUnsafe(pattern));
|
|
45
47
|
return result;
|
|
46
48
|
}
|
|
47
49
|
export function RecordValue(type) {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -25,7 +25,7 @@ $ npm install typebox
|
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
28
|
-
A TypeScript
|
|
28
|
+
A TypeScript engine for JSON Schema [Example](https://tsplay.dev/mZMOeN)
|
|
29
29
|
|
|
30
30
|
```typescript
|
|
31
31
|
import Type from 'typebox'
|
|
@@ -212,7 +212,7 @@ type S = Type.Static<typeof S> // type S = {
|
|
|
212
212
|
|
|
213
213
|
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/compile/overview) | [Example](https://tsplay.dev/WyraZw)
|
|
214
214
|
|
|
215
|
-
The Compile submodule is a high-performance JSON Schema compliant JIT compiler that
|
|
215
|
+
The Compile submodule is a high-performance, JSON Schema compliant JIT compiler that transforms schematics into efficient runtime validators. It is optimized for fast, dynamic schema compilation and delivers extremely high data-validation throughput.
|
|
216
216
|
|
|
217
217
|
```typescript
|
|
218
218
|
import Compile from 'typebox/compile'
|