diff --git a/benchmark/structures/typebox/TypeboxArrayHierarchical.ts b/benchmark/structures/typebox/TypeboxArrayHierarchical.ts index 6dc4867e50..a063d74332 100644 --- a/benchmark/structures/typebox/TypeboxArrayHierarchical.ts +++ b/benchmark/structures/typebox/TypeboxArrayHierarchical.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Timestamp = Type.Object({ time: Type.Number(), @@ -31,8 +31,8 @@ const Company = Type.Object({ departments: Type.Array(Department), }); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxArrayHierarchical = Type.Array(Company); export const TypeboxArrayHierarchical = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxArrayRecursive.ts b/benchmark/structures/typebox/TypeboxArrayRecursive.ts index 0d500fc9d5..1f6b7f6baa 100644 --- a/benchmark/structures/typebox/TypeboxArrayRecursive.ts +++ b/benchmark/structures/typebox/TypeboxArrayRecursive.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Timestamp = Type.Object({ time: Type.Number(), @@ -17,8 +17,8 @@ const Category = Type.Recursive((Category) => }), ); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxArrayRecursive = Category; export const TypeboxArrayRecursive = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxArrayRecursiveUnionExplicit.ts b/benchmark/structures/typebox/TypeboxArrayRecursiveUnionExplicit.ts index 4a67c6b244..11dd880e48 100644 --- a/benchmark/structures/typebox/TypeboxArrayRecursiveUnionExplicit.ts +++ b/benchmark/structures/typebox/TypeboxArrayRecursiveUnionExplicit.ts @@ -1,6 +1,6 @@ import { TSchema, Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const ImageFile = Type.Object({ id: Type.Number(), @@ -63,8 +63,8 @@ const Bucket = Type.Recursive((Bucket) => ]), ); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxArrayRecursiveUnionExplicit = Type.Array(Bucket); export const TypeboxArrayRecursiveUnionExplicit = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxArrayRecursiveUnionImplicit.ts b/benchmark/structures/typebox/TypeboxArrayRecursiveUnionImplicit.ts index 45aa2d8795..dcc8391d30 100644 --- a/benchmark/structures/typebox/TypeboxArrayRecursiveUnionImplicit.ts +++ b/benchmark/structures/typebox/TypeboxArrayRecursiveUnionImplicit.ts @@ -1,6 +1,6 @@ import { TSchema, Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const ImageFile = Type.Object({ id: Type.Number(), @@ -64,8 +64,8 @@ const Bucket = Type.Recursive((bucket) => ]), ); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxArrayRecursiveUnionImplicit = Type.Array(Bucket); export const TypeboxArrayRecursiveUnionImplicit = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxArraySimple.ts b/benchmark/structures/typebox/TypeboxArraySimple.ts index 6f467a7c01..d4e67b8bd2 100644 --- a/benchmark/structures/typebox/TypeboxArraySimple.ts +++ b/benchmark/structures/typebox/TypeboxArraySimple.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Hobby = Type.Object({ name: Type.String(), @@ -21,8 +21,8 @@ const Person = Type.Object({ ]), }); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxArraySimple = Type.Array(Person); export const TypeboxArraySimple = TypeCompiler.Compile(__TypeboxArraySimple); diff --git a/benchmark/structures/typebox/TypeboxObjectHierarchical.ts b/benchmark/structures/typebox/TypeboxObjectHierarchical.ts index db2a26588d..273878d395 100644 --- a/benchmark/structures/typebox/TypeboxObjectHierarchical.ts +++ b/benchmark/structures/typebox/TypeboxObjectHierarchical.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Timestamp = Type.Object({ time: Type.Number(), @@ -56,8 +56,8 @@ const Customer = Type.Object({ created_at: Timestamp, }); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxObjectHierarchical = Customer; export const TypeboxObjectHierarchical = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxObjectRecursive.ts b/benchmark/structures/typebox/TypeboxObjectRecursive.ts index 6081e80455..07a9e0857c 100644 --- a/benchmark/structures/typebox/TypeboxObjectRecursive.ts +++ b/benchmark/structures/typebox/TypeboxObjectRecursive.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Timestamp = Type.Object({ time: Type.Number(), @@ -18,8 +18,8 @@ const Department = Type.Recursive((Department) => }), ); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxObjectRecursive = Department; export const TypeboxObjectRecursive = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxObjectSimple.ts b/benchmark/structures/typebox/TypeboxObjectSimple.ts index b857a2e2cf..9075e5145a 100644 --- a/benchmark/structures/typebox/TypeboxObjectSimple.ts +++ b/benchmark/structures/typebox/TypeboxObjectSimple.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Point3D = Type.Object({ x: Type.Number(), @@ -15,8 +15,8 @@ const Box3D = Type.Object({ pivot: Point3D, }); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxObjectSimple = Box3D; export const TypeboxObjectSimple = TypeCompiler.Compile(__TypeboxObjectSimple); diff --git a/benchmark/structures/typebox/TypeboxObjectUnionExplicit.ts b/benchmark/structures/typebox/TypeboxObjectUnionExplicit.ts index aea7aea375..c74c4006c4 100644 --- a/benchmark/structures/typebox/TypeboxObjectUnionExplicit.ts +++ b/benchmark/structures/typebox/TypeboxObjectUnionExplicit.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Point = Type.Object({ x: Type.Number(), @@ -80,8 +80,8 @@ const Union = Type.Union([ ]), ]); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxObjectUnionExplicit = Type.Array(Union); export const TypeboxObjectUnionExplicit = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxObjectUnionImplicit.ts b/benchmark/structures/typebox/TypeboxObjectUnionImplicit.ts index 0c3138aec6..f9e4008249 100644 --- a/benchmark/structures/typebox/TypeboxObjectUnionImplicit.ts +++ b/benchmark/structures/typebox/TypeboxObjectUnionImplicit.ts @@ -1,6 +1,6 @@ import { Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Point = Type.Object({ x: Type.Number(), @@ -54,8 +54,8 @@ const Union = Type.Union([ Circle, ]); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxObjectUnionImplicit = Type.Array(Union); export const TypeboxObjectUnionImplicit = TypeCompiler.Compile( diff --git a/benchmark/structures/typebox/TypeboxUltimateUnion.ts b/benchmark/structures/typebox/TypeboxUltimateUnion.ts index abbfb04d1a..4cd2a4b980 100644 --- a/benchmark/structures/typebox/TypeboxUltimateUnion.ts +++ b/benchmark/structures/typebox/TypeboxUltimateUnion.ts @@ -1,6 +1,6 @@ import { TSchema, Type } from "@sinclair/typebox"; import { TypeCompiler } from "@sinclair/typebox/compiler"; -import { TypeSystem } from "@sinclair/typebox/system"; +import { TypeSystemPolicy } from "@sinclair/typebox/system"; const Attribute = { description: Type.Optional(Type.String()), @@ -129,8 +129,8 @@ const Schema = Type.Recursive((schema) => ]), ); -TypeSystem.AllowArrayObjects = true; -TypeSystem.AllowNaN = true; +TypeSystemPolicy.AllowArrayObject = true; +TypeSystemPolicy.AllowNaN = true; export const __TypeboxUltimateUnion = Type.Array(Application(Schema)); export const TypeboxUltimateUnion = TypeCompiler.Compile( diff --git a/package.json b/package.json index b07ca9b0b8..9f02260114 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "typescript": ">= 4.7.4" }, "devDependencies": { - "@fastify/type-provider-typebox": "^3.0.0", + "@fastify/type-provider-typebox": "^3.5.0", "@trivago/prettier-plugin-sort-imports": "^3.3.0", "@typegoose/typegoose": "^10.1.1", "@types/autocannon": "^7.9.0",