-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
573cdb1
commit 81bae60
Showing
245 changed files
with
12,253 additions
and
5,166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Array, Any } from '@sinclair/typebox' | ||
|
||
const T = Array(Any()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Boolean } from '@sinclair/typebox' | ||
|
||
const T = Boolean() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Any, Extends } from '@sinclair/typebox' | ||
|
||
const T = Extends(Any(), Any(), Any(), Any()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Null } from '@sinclair/typebox' | ||
|
||
const T = Null() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Number } from '@sinclair/typebox' | ||
|
||
const T = Number() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Object } from '@sinclair/typebox' | ||
|
||
const T = Object({}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Record, Any } from '@sinclair/typebox' | ||
|
||
const T = Record(Any(), Any()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { String } from '@sinclair/typebox' | ||
|
||
const T = String() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Type } from '@sinclair/typebox' | ||
|
||
const T = Type.String() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Cast } from '@sinclair/typebox/value/cast' | ||
|
||
console.log(Cast) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Check } from '@sinclair/typebox/value/check' | ||
|
||
console.log(Check) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Convert } from '@sinclair/typebox/value/convert' | ||
|
||
console.log(Convert) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Create } from '@sinclair/typebox/value/create' | ||
|
||
console.log(Create) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { Type } from '@sinclair/typebox' | ||
import Type from '@sinclair/typebox' | ||
|
||
const T = Type.String() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## [0.32.0](https://www.npmjs.com/package/@sinclair/typebox/v/0.32.0) | ||
|
||
## Overview | ||
|
||
Revision 0.32.0 is milestone revision for the TypeBox project. This revision focuses on the modularization of all TypeBox types, reducing TypeBuilder size and reimplementing much of the TypeBox core to provide better inference stability for both indexed access types, composite types as well as to make provisions for ESM publishing in future. | ||
|
||
This revision passes tests for TypeBox's public API, however internal type names related to inference resolution have been removed in this revision. This constitutes a minor breaking change. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,28 @@ | ||
import { TypeSystem } from '@sinclair/typebox/system' | ||
import { TypeCompiler } from '@sinclair/typebox/compiler' | ||
import { Value, ValuePointer } from '@sinclair/typebox/value' | ||
import { Type, TypeGuard, Kind, Static, TSchema } from '@sinclair/typebox' | ||
|
||
// ----------------------------------------------------------- | ||
// Create: Type | ||
// ----------------------------------------------------------- | ||
|
||
const T = Type.Object({ | ||
x: Type.Number(), | ||
y: Type.Number(), | ||
z: Type.Number(), | ||
import { Type, TypeGuard, Kind, Static, TSchema, TTuple, TIntersect, TUnion, TPromise, TAsyncIterator, TIterator, TArray, TConstructor, TFunction, Clone, TRef, TObject, TProperties } from '@sinclair/typebox' | ||
import { CloneType } from '@sinclair/typebox' | ||
import { ValueGuard } from '@sinclair/typebox' | ||
|
||
const T = Type.Object( | ||
{ | ||
x: Type.Number(), | ||
y: Type.String(), | ||
}, | ||
{ $id: 'T' }, | ||
) | ||
|
||
const R1 = Type.Ref<typeof T>('T', { $id: 'R1' }) | ||
const R2 = Type.Ref<typeof R1>('R1', { $id: 'R2' }) | ||
const R3 = Type.Ref<typeof R2>('R2', { $id: 'R3' }) | ||
const R4 = Type.Ref<typeof R3>('R3', { $id: 'R4' }) | ||
|
||
const S = Type.Object({ | ||
a: Type.Ref<typeof R4>('R4'), | ||
b: Type.Ref<typeof R4>('R4'), | ||
}) | ||
|
||
type T = Static<typeof T> | ||
|
||
console.log(T) | ||
|
||
// ----------------------------------------------------------- | ||
// Create: Value | ||
// ----------------------------------------------------------- | ||
|
||
const V = Value.Create(T) | ||
|
||
console.log(V) | ||
|
||
// ----------------------------------------------------------- | ||
// Compile: Type | ||
// ----------------------------------------------------------- | ||
|
||
const C = TypeCompiler.Compile(T) | ||
|
||
console.log(C.Code()) | ||
|
||
// ----------------------------------------------------------- | ||
// Check: Value | ||
// ----------------------------------------------------------- | ||
const X = Type.Deref(S, [T, R1, R2, R3, R4]) | ||
|
||
console.log(C.Check(V)) | ||
console.log(X) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.