diff --git a/example/index.ts b/example/index.ts index 75d4d61..ed8d1cd 100644 --- a/example/index.ts +++ b/example/index.ts @@ -8,8 +8,11 @@ import { Custom } from '@sinclair/typebox/custom' import { Value, ValuePointer } from '@sinclair/typebox/value' import { Type, Kind, Static, TSchema } from '@sinclair/typebox' +// ----------------------------------------------------------- +// Create: Type +// ----------------------------------------------------------- + const T = Type.Object({ - /** It's a X */ x: Type.Number(), y: Type.Number(), z: Type.Number(), @@ -18,3 +21,25 @@ const T = Type.Object({ type T = Static 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 +// ----------------------------------------------------------- + +console.log(C.Check(V))