typebox 1.0.65 → 1.0.67

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.
@@ -34,7 +34,8 @@ export declare function IsGreaterThan(left: string, right: string): string;
34
34
  export declare function IsLessThan(left: string, right: string): string;
35
35
  export declare function IsLessEqualThan(left: string, right: string): string;
36
36
  export declare function IsGreaterEqualThan(left: string, right: string): string;
37
- export declare function StringGraphemeCount(value: string): string;
37
+ export declare function IsMinLength(value: string, length: string): string;
38
+ export declare function IsMaxLength(value: string, length: string): string;
38
39
  export declare function Every(value: string, offset: string, params: [value: string, index: string], expression: string): string;
39
40
  export declare function Entries(value: string): string;
40
41
  export declare function Keys(value: string): string;
@@ -104,8 +104,11 @@ export function IsGreaterEqualThan(left, right) {
104
104
  // --------------------------------------------------------------------------
105
105
  // String
106
106
  // --------------------------------------------------------------------------
107
- export function StringGraphemeCount(value) {
108
- return `Guard.StringGraphemeCount(${value})`;
107
+ export function IsMinLength(value, length) {
108
+ return `Guard.IsMinLength(${value}, ${length})`;
109
+ }
110
+ export function IsMaxLength(value, length) {
111
+ return `Guard.IsMaxLength(${value}, ${length})`;
109
112
  }
110
113
  // --------------------------------------------------------------------------
111
114
  // Array
@@ -181,7 +184,7 @@ export function ReduceOr(operands) {
181
184
  return G.IsEqual(operands.length, 0) ? 'false' : operands.reduce((left, right) => Or(left, right));
182
185
  }
183
186
  // --------------------------------------------------------------------------
184
- // Arithmatic
187
+ // Arithmetic
185
188
  // --------------------------------------------------------------------------
186
189
  export function PrefixIncrement(expression) {
187
190
  return `++${expression}`;
@@ -37,8 +37,12 @@ export declare function IsMultipleOf(dividend: bigint | number, divisor: bigint
37
37
  /** Returns true if the value appears to be an instance of a class. */
38
38
  export declare function IsClassInstance(value: unknown): boolean;
39
39
  export declare function IsValueLike(value: unknown): value is bigint | boolean | null | number | string | undefined;
40
- /** Returns the number of Unicode Grapheme Clusters */
41
- export declare function StringGraphemeCount(value: string): number;
40
+ /** Returns the number of grapheme clusters in the string */
41
+ export declare function GraphemeCount(value: string): number;
42
+ /** Returns true if the string has at most the given number of graphemes */
43
+ export declare function IsMaxLength(value: string, length: number): boolean;
44
+ /** Returns true if the string has at least the given number of graphemes */
45
+ export declare function IsMinLength(value: string, length: number): boolean;
42
46
  export declare function Every<T>(value: T[], offset: number, callback: (value: T, index: number) => boolean): boolean;
43
47
  export declare function EveryAll<T>(value: T[], offset: number, callback: (value: T, index: number) => boolean): boolean;
44
48
  /** Returns true if this value has this property key */
@@ -1,3 +1,4 @@
1
+ import * as String from './string.mjs';
1
2
  // --------------------------------------------------------------------------
2
3
  // Guards
3
4
  // --------------------------------------------------------------------------
@@ -129,9 +130,17 @@ export function IsValueLike(value) {
129
130
  // --------------------------------------------------------------------------
130
131
  // String
131
132
  // --------------------------------------------------------------------------
132
- /** Returns the number of Unicode Grapheme Clusters */
133
- export function StringGraphemeCount(value) {
134
- return Array.from(value).length;
133
+ /** Returns the number of grapheme clusters in the string */
134
+ export function GraphemeCount(value) {
135
+ return String.GraphemeCount(value);
136
+ }
137
+ /** Returns true if the string has at most the given number of graphemes */
138
+ export function IsMaxLength(value, length) {
139
+ return String.IsMaxLengthFast(value, length);
140
+ }
141
+ /** Returns true if the string has at least the given number of graphemes */
142
+ export function IsMinLength(value, length) {
143
+ return String.IsMinLengthFast(value, length);
135
144
  }
136
145
  // --------------------------------------------------------------------------
137
146
  // Array
@@ -0,0 +1,10 @@
1
+ /** Returns the number of grapheme clusters in a string */
2
+ export declare function GraphemeCount(value: string): number;
3
+ /** Checks if a string has at least a minimum number of grapheme clusters */
4
+ export declare function IsMinLength(value: string, minLength: number): boolean;
5
+ /** Checks if a string has at most a maximum number of grapheme clusters */
6
+ export declare function IsMaxLength(value: string, maxLength: number): boolean;
7
+ /** Fast check for minimum grapheme length, falls back to full check if needed */
8
+ export declare function IsMinLengthFast(value: string, minLength: number): boolean;
9
+ /** Fast check for maximum grapheme length, falls back to full check if needed */
10
+ export declare function IsMaxLengthFast(value: string, maxLength: number): boolean;
@@ -0,0 +1,154 @@
1
+ // --------------------------------------------------------------------------
2
+ // IsBetween
3
+ // --------------------------------------------------------------------------
4
+ function IsBetween(value, min, max) {
5
+ return value >= min && value <= max;
6
+ }
7
+ // --------------------------------------------------------------------------
8
+ // IsRegionalIndicator
9
+ // --------------------------------------------------------------------------
10
+ function IsRegionalIndicator(value) {
11
+ return IsBetween(value, 0x1F1E6, 0x1F1FF);
12
+ }
13
+ // --------------------------------------------------------------------------
14
+ // IsVariationSelector
15
+ // --------------------------------------------------------------------------
16
+ function IsVariationSelector(value) {
17
+ return IsBetween(value, 0xFE00, 0xFE0F);
18
+ }
19
+ // --------------------------------------------------------------------------
20
+ // IsCombiningMark
21
+ // --------------------------------------------------------------------------
22
+ function IsCombiningMark(value) {
23
+ return (IsBetween(value, 0x0300, 0x036F) ||
24
+ IsBetween(value, 0x1AB0, 0x1AFF) ||
25
+ IsBetween(value, 0x1DC0, 0x1DFF) ||
26
+ IsBetween(value, 0xFE20, 0xFE2F));
27
+ }
28
+ // --------------------------------------------------------------------------
29
+ // CodePointLength
30
+ // --------------------------------------------------------------------------
31
+ function CodePointLength(value) {
32
+ return value > 0xFFFF ? 2 : 1;
33
+ }
34
+ // --------------------------------------------------------------------------
35
+ // ConsumeModifiers (helper)
36
+ // --------------------------------------------------------------------------
37
+ function ConsumeModifiers(value, index) {
38
+ while (index < value.length) {
39
+ const point = value.codePointAt(index);
40
+ if (IsCombiningMark(point) || IsVariationSelector(point)) {
41
+ index += CodePointLength(point);
42
+ }
43
+ else {
44
+ break;
45
+ }
46
+ }
47
+ return index;
48
+ }
49
+ // --------------------------------------------------------------------------
50
+ // NextGraphemeClusterIndex
51
+ // --------------------------------------------------------------------------
52
+ function NextGraphemeClusterIndex(value, clusterStart) {
53
+ const startCP = value.codePointAt(clusterStart);
54
+ let clusterEnd = clusterStart + CodePointLength(startCP);
55
+ // Consume combining marks & variation selectors
56
+ clusterEnd = ConsumeModifiers(value, clusterEnd);
57
+ // Handle multi-ZWJ sequences
58
+ while (clusterEnd < value.length - 1 && value[clusterEnd] === '\u200D') {
59
+ const nextCP = value.codePointAt(clusterEnd + 1);
60
+ clusterEnd += 1 + CodePointLength(nextCP);
61
+ clusterEnd = ConsumeModifiers(value, clusterEnd);
62
+ }
63
+ // Handle regional indicator pairs (flags)
64
+ if (IsRegionalIndicator(startCP) &&
65
+ clusterEnd < value.length &&
66
+ IsRegionalIndicator(value.codePointAt(clusterEnd))) {
67
+ clusterEnd += CodePointLength(value.codePointAt(clusterEnd));
68
+ }
69
+ return clusterEnd;
70
+ }
71
+ // --------------------------------------------------------------------------
72
+ // IsGraphemeCodePoint
73
+ // --------------------------------------------------------------------------
74
+ function IsGraphemeCodePoint(value) {
75
+ return (IsBetween(value, 0xD800, 0xDBFF) || // High surrogate
76
+ IsBetween(value, 0x0300, 0x036F) || // Combining diacritical marks
77
+ (value === 0x200D) // Zero-width joiner
78
+ );
79
+ }
80
+ // --------------------------------------------------------------------------
81
+ // GraphemeCount
82
+ // --------------------------------------------------------------------------
83
+ /** Returns the number of grapheme clusters in a string */
84
+ export function GraphemeCount(value) {
85
+ let count = 0;
86
+ let index = 0;
87
+ while (index < value.length) {
88
+ index = NextGraphemeClusterIndex(value, index);
89
+ count++;
90
+ }
91
+ return count;
92
+ }
93
+ // --------------------------------------------------------------------------
94
+ // IsMinLength
95
+ // --------------------------------------------------------------------------
96
+ /** Checks if a string has at least a minimum number of grapheme clusters */
97
+ export function IsMinLength(value, minLength) {
98
+ let count = 0;
99
+ let index = 0;
100
+ while (index < value.length) {
101
+ index = NextGraphemeClusterIndex(value, index);
102
+ count++;
103
+ if (count >= minLength)
104
+ return true;
105
+ }
106
+ return false;
107
+ }
108
+ // --------------------------------------------------------------------------
109
+ // IsMaxLength
110
+ // --------------------------------------------------------------------------
111
+ /** Checks if a string has at most a maximum number of grapheme clusters */
112
+ export function IsMaxLength(value, maxLength) {
113
+ let count = 0;
114
+ let index = 0;
115
+ while (index < value.length) {
116
+ index = NextGraphemeClusterIndex(value, index);
117
+ count++;
118
+ if (count > maxLength)
119
+ return false;
120
+ }
121
+ return true;
122
+ }
123
+ // --------------------------------------------------------------------------
124
+ // IsMinLengthFast
125
+ // --------------------------------------------------------------------------
126
+ /** Fast check for minimum grapheme length, falls back to full check if needed */
127
+ export function IsMinLengthFast(value, minLength) {
128
+ let index = 0;
129
+ while (index < value.length) {
130
+ if (IsGraphemeCodePoint(value.charCodeAt(index))) {
131
+ return IsMinLength(value, minLength);
132
+ }
133
+ index++;
134
+ if (index >= minLength)
135
+ return true;
136
+ }
137
+ return false;
138
+ }
139
+ // --------------------------------------------------------------------------
140
+ // IsMaxLengthFast
141
+ // --------------------------------------------------------------------------
142
+ /** Fast check for maximum grapheme length, falls back to full check if needed */
143
+ export function IsMaxLengthFast(value, maxLength) {
144
+ let index = 0;
145
+ while (index < value.length) {
146
+ if (IsGraphemeCodePoint(value.charCodeAt(index))) {
147
+ return IsMaxLength(value, maxLength);
148
+ }
149
+ index++;
150
+ if (index > maxLength)
151
+ return false;
152
+ }
153
+ return true;
154
+ }
@@ -4,13 +4,13 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
4
4
  // Build
5
5
  // ------------------------------------------------------------------
6
6
  export function BuildMaxLength(stack, context, schema, value) {
7
- return E.IsLessEqualThan(E.StringGraphemeCount(value), E.Constant(schema.maxLength));
7
+ return E.IsMaxLength(value, E.Constant(schema.maxLength));
8
8
  }
9
9
  // ------------------------------------------------------------------
10
10
  // Check
11
11
  // ------------------------------------------------------------------
12
12
  export function CheckMaxLength(stack, context, schema, value) {
13
- return G.IsLessEqualThan(G.StringGraphemeCount(value), schema.maxLength);
13
+ return G.IsMaxLength(value, schema.maxLength);
14
14
  }
15
15
  // ------------------------------------------------------------------
16
16
  // Error
@@ -4,13 +4,13 @@ import { Guard as G, EmitGuard as E } from '../../guard/index.mjs';
4
4
  // Build
5
5
  // ------------------------------------------------------------------
6
6
  export function BuildMinLength(stack, context, schema, value) {
7
- return E.IsGreaterEqualThan(E.StringGraphemeCount(value), E.Constant(schema.minLength));
7
+ return E.IsMinLength(value, E.Constant(schema.minLength));
8
8
  }
9
9
  // ------------------------------------------------------------------
10
10
  // Check
11
11
  // ------------------------------------------------------------------
12
12
  export function CheckMinLength(stack, context, schema, value) {
13
- return G.IsGreaterEqualThan(G.StringGraphemeCount(value), schema.minLength);
13
+ return G.IsMinLength(value, schema.minLength);
14
14
  }
15
15
  // ------------------------------------------------------------------
16
16
  // Error
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
4
- "version": "1.0.65",
4
+ "version": "1.0.67",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"
package/readme.md CHANGED
@@ -25,9 +25,13 @@ $ npm install typebox
25
25
 
26
26
  ## Usage
27
27
 
28
+ A TypeScript engine for Json Schema [Reference](https://tsplay.dev/wOyMRm)
29
+
28
30
  ```typescript
29
31
  import Type from 'typebox'
30
32
 
33
+ // Json Schema
34
+
31
35
  const T = Type.Object({ // const T = {
32
36
  x: Type.Number(), // type: 'object',
33
37
  y: Type.Number(), // required: ['x', 'y', 'z'],
@@ -43,6 +47,26 @@ type T = Type.Static<typeof T> // type T = {
43
47
  // y: number,
44
48
  // z: number
45
49
  // }
50
+
51
+ // TypeScript
52
+
53
+ const { S } = Type.Script({ T }, `
54
+ type RenameKey<K> =
55
+ K extends 'x' ? 'a' :
56
+ K extends 'y' ? 'b' :
57
+ K extends 'z' ? 'c' :
58
+ K
59
+
60
+ type S = {
61
+ readonly [K in keyof T as RenameKey<K>]: string
62
+ }
63
+ `)
64
+
65
+ type S = Type.Static<typeof S> // type S = {
66
+ // readonly a: string,
67
+ // readonly b: string,
68
+ // readonly c: string
69
+ // }
46
70
  ```
47
71
 
48
72
  ## Overview
@@ -75,9 +99,9 @@ If upgrading from `@sinclair/typebox` refer to the 1.0 migration guide at the fo
75
99
 
76
100
  ## Type
77
101
 
78
- [Documentation](https://sinclairzx81.github.io/typebox/#/docs/type/overview) | [Example](https://www.typescriptlang.org/play/#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgYwgDsBneBOAXkSIDoB5YgK1Q0YACgDecSVOkzZcuAHoFcOkxbs4YypLIAuTmi4A5AK4hiqKCICUAGnkPHspVMJp9eCAKEw8t7XBI+siGpuaWNvZO0Q4uklCoAI4mwAkAJvoA2ngU9nhIfvgAXngAuv6SRcHcYRZW1jGNcnFwYNhosMCojPpaAL4NTUPDisrSeppwbqge9GZ1eHB9FSOrjS2SQZPTs-OWi8sBa8exY1JV20S74VAHRycP0i1994+PLi+U04gaIahcAGUYABDGDAGgAHmmEAwiAAfCcXN9WBwtG90aMpBM5jcVhiHi0tji6nj8ccWhdiZZXmSRh8gA)
102
+ [Documentation](https://sinclairzx81.github.io/typebox/#/docs/type/overview) | [Example](https://tsplay.dev/NaMoBN)
79
103
 
80
- TypeBox includes many functions to create Json Schema types. Each function returns a small Json Schema fragment that corresponds to a TypeScript type. TypeBox uses function composition to combine schema fragments into more complex types. It provides a set of functions that are used to model Json Schema schematics as well as a set of functions that model constructs native to JavaScript and TypeScript.
104
+ TypeBox provides many functions to create Json Schema types. Each function returns a small Json Schema fragment that can be composed into more complex types. TypeBox includes a set of functions that are used to construct Json Schema compliant schematics as well as a set of extended functions that return schematics for constructs native to JavaScript.
81
105
 
82
106
  ## Example
83
107
 
@@ -123,9 +147,9 @@ const S = Type.Number({ // const S = {
123
147
 
124
148
  ## Value
125
149
 
126
- [Documentation](https://sinclairzx81.github.io/typebox/#/docs/value/overview) | [Example](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBANQIYBsCuBTOAzKERwDkMAnmBgEYQAeA9AG6qaEBQokscAKmVrvkVLkq1ViwDGEAHYBneFzgBebrwB0AeQoArDOJgAKAN4s4cagC4V5VQDk0IChij6AlABoTcEpZ7W7Dp1cPUwAvHzV-R2cXFgBfGIlpOTgAQSVEJgxVAAUkKBkMfS43OENTcorKqqraWjhJWXgUy2NTCzgARhLqnt6+vtry9ql7KOCvSwAGbv7ZuerB0284EYCocbC4Sfmd3bhFuE3VqLiXPfOdwdj01VugA)
150
+ [Documentation](https://sinclairzx81.github.io/typebox/#/docs/value/overview) | [Example](https://tsplay.dev/W4YE1w)
127
151
 
128
- The Value module provides functions that perform typed operations on JavaScript values. It includes functions such as Check, Parse, Clone, Encode, Decode and as well as advanced functions to perform structural Diff and Patch on dynamic JavaScript values.
152
+ The Value submodule provides functions for validation and other typed operations on JavaScript values. It includes functions such as Check, Parse, Clone, Encode, and Decode, as well as advanced functions for performing structural Diff and Patch operations on dynamic JavaScript values.
129
153
 
130
154
  ```typescript
131
155
  import Value from 'typebox/value'
@@ -154,9 +178,9 @@ const A = Value.Parse(T, { // const A: {
154
178
 
155
179
  ## Compile
156
180
 
157
- [Documentation](https://sinclairzx81.github.io/typebox/#/docs/compile/overview) | [Example](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYQuYAbApnAvnAMyjTgHIYBPMLAIwgA8B6AYzTEy1IChRJY4AKlRxES5YXXrcurAHYBneMjgBeFGw4AKIdQB0AeRoArLMxiakcK9Zu3bjRnDmKUALjgA1AIYZgAEy8YaAAeBFwAGkFDEzNQrit6dx0sXQA5AFcQGiwoTQBKSLsi4pKrB2tEwQysnPD4uAok4TTM7NyC0s6u8qtGqtba+oAvJr1qtvyuqZKeuBH+mqguXDy86fWNm3LcAD4drhkIBXgAQVUUXQAFLyh5LAtNjfLnU-cEesqABkLH37tZyqyAZQOq9dwARh+f2hcFmfSBi1Bc3cnxhaNhjis8wRbWWa3RBO2510JKAA)
181
+ [Documentation](https://sinclairzx81.github.io/typebox/#/docs/compile/overview) | [Example](https://tsplay.dev/WyraZw)
158
182
 
159
- The Compile module is a high-performance JIT compiler that transforms types into efficient runtime validators. The compiler is optimized for both fast compilation and validation.
183
+ The Compile submodule is a high-performance Json Schema compliant JIT compiler that compiles schematics into efficient runtime validators. The compiler is optimized for fast compilation and validation and is known to be one of the fastest validation solutions available for JavaScript.
160
184
 
161
185
  ```typescript
162
186
  import { Compile } from 'typebox/compile'
@@ -182,9 +206,9 @@ const A = C.Parse({ // const A: {
182
206
 
183
207
  ## Script
184
208
 
185
- [Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgGUBjKYMGVAE0SOqYgB2AZ3gI4AXh5oAdM1bsAFAAMA3nEpw4ZAFxwBAVxDFUUADTrNSXSNYCA5uY1wAXrtIQANqgCGA9QF8lAEpNULDwiMio6PC6OH5hUV0EAHliACtUJhgAHhUnGMKi4rC4zR1EADlDYzMCkobG0vpLZIYYWwd6pp7ispdkgCEITx8Bbt7JqLj-AD5qOIApIUFGJgALVBBvOABJAQ6IITRs4EFqBGlCNCnb0Li8CAysmCpLqFQAR31gD+47npxADaeAo5jwSDw4OceAAupRLmBsGhYMBUEIAY04moKtI8eYrHA8dJzK4iXi4P4FvQ5GwONxkDcFABhHBgfT0oJ8QQiRgSKSoWQsOkKNRifzmVROIEAaTgwD8AGtUEgIBhELDkrLYXAAD56fQeDyUQIhTF3OIJXkMZJpTLZPITc2TfoVBAAVQEZwEOSBCGqRhM5n9ho8sNmpidzsBLTghI9XsEvoQ7U6weqRvDkejAP6ZIT3uTw1GvnTofDUZzDRm81oNJgvk43ig3H2GBMqAETFQ1Gu6AY-MZgva3hgwCYOT7asYs1ucT7fMk+Src9jFQMgageoNRuzK5dscJNgVdm3Bl3lf3hTzbhGXl8Z9Dl6v0RmQA) | [Example 2](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgAkIA3VKOGAC1QGd0NocYADsMbVMIDG6ABQ9OEAK4AbACZwQAQxiTOHbnB6SowMDFTrCaAJSVUZSLA5E4AMQgQ4AXkREAdADKMNrAkgA8VqgQGG4eAHx2DtDwkXAAQprsPshogcEwoRFE0emZCbT0AMIQYEhwmsLqYJo85ogBzmg8QsIwnjmogcamMDJ+49b1jXAA5qjwxJqSANadqAC0PJpicABSAQDyAHJwAbqoWomO8JIQwq1wAN6xEAA0pewAvt6+uWcmZhkAANKKl3J4fI9KHA4GQAFxwYSKEDENjQuBIBFIlFomEALyxyNRUEon2oqQyWSe6KgqE0qjuyjqAG0ANI9ODLVBIErg+rdACymjAYVZcQAugiAIKqZgNaSqUVxOAAHxebPFpPJLhlcqkFlF3PeADVMsAGjBuj48AANPCq-AATXtarwAC08MqfDJ0QAdIG+gAkjwAqmA0FBJC1UIakHFPkHHqaTBaeJ91qBIDweMBiMpUP7KLZQS4hSLWdyvXAwxGo3wwuiK3V7OZGt08BQ4AB+fCae1wxvcuAtiSqdtIe09vDEfuD5tkVtj-B4yf4SSzmHCVCsEnlIG2OhwA6KGBgE9rbqZfgqJlwWkYfOSYJ59D7Y6nc6XcF+VIwv---9DzwCBiAAK1QJ97TgShvzAbAIwKXgAL-Q9nnhOBxj8d5MQw8Z3gJXC-DgMlv1pABHRRgFpdRkJQ+hmQ7PB3jwCdmJXcUgA)
209
+ [Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://tsplay.dev/Wk6L1m) | [Example 2](https://tsplay.dev/NnrJoN)
186
210
 
187
- TypeBox includes a TypeScript scripting engine able to parse TypeScript types directly into Json Schema. The engine uses symmetric runtime and type-level parsing and returns typed safe schematics from TypeScript types (including computed types). The engine is designed for TypeScript 7 native compiler but is supported in TypeScript 5 and above.
211
+ TypeBox is a runtime TypeScript DSL engine that can create, transform, and compute Json Schema using native TypeScript syntax. The engine is implemented symmetrically at runtime and within the TypeScript type system, and is intended for use with the TypeScript 7 native compiler and above.
188
212
 
189
213
  ```typescript
190
214
  // Scripted Type
@@ -228,7 +252,7 @@ type S = Type.Static<typeof S> // type S = {
228
252
 
229
253
  ## Schema
230
254
 
231
- [Documentation](https://sinclairzx81.github.io/typebox/#/docs/schema/overview) | [Example 1](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYQuYAbApnAvnAMyjTgHIYBPMLAIwgA8B6AYzTEy1ICgfWA7AM7xkcALwo2HABQIucOJWoAuMhBoArLMxikANHLhQsARwCuwIwBMVAbVL09ZCo9IAvUgF198sMWqxgLAEVWXl5ehCFKiwVUj5TEBosKFI8bzCKSMUYsnjE5NTcdPlXLOjYvKSUvANcLlwASl4IQXgAQTEUADoABQBDKAEsGTDRsfGJycZGOH4hODaQgwi4AAZdSc2t7YnpsJXK5PTMtY2d84uxvfkTw6h00rgARkvXy+u4R7v6hre-95m+HEXRBQA) | [Example 2](https://tsplay.dev/mxrl7w)
255
+ [Documentation](https://sinclairzx81.github.io/typebox/#/docs/schema/overview) | [Example 1](https://tsplay.dev/Wvrv3W) | [Example 2](https://tsplay.dev/m3g0ym)
232
256
 
233
257
  TypeBox is built upon a high-performance validation infrastructure that supports the direct compilation and inference of Json Schema schematics. TypeBox implements Draft 3 to 2020-12 and is compliance tested via the official Json Schema [Test Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite). It offers high-performance JIT compilation with automatic fallback to dynamic checking in JIT restricted environments.
234
258