- Rename package from @sinclair/typebox to @alkdev/typebox - Update author, repository, and homepage to alkdev - Remove GitHub workflows, .vscode config, and branding assets - Update all source, test, example, changelog, and task imports - Update tsconfig.json path mappings - Clean up readme header (remove upstream badges/branding)
2.1 KiB
2.1 KiB
0.24.0
Changes:
- The
kindandmodifierkeywords are now expressed as symbol keys. This change allows AJV to leverage TypeBox schemas directly without explicit configuration ofkindandmodifierin strict mode. Type.Intersect([...])now returns a compositeTObjectinstead of aallOfschema representation. This change allows intersected types to be leveraged in calls toOmit,Pick,Partial,Required.Type.Void(...)now generates a{ type: null }schema representation. This is principally used for RPC implementations where a RPC target function needs to respond with a serializable value forvoidreturn.Type.Rec(...)renamed toType.Recursive(...)and now supports non-mutual recursive type inference.
Added:
Type.Unsafe<T>(...). This type enables custom schema representations whose static type is informed by generic type T.Type.Uint8Array(...). This is a non-standard schema that can be configured on AJV to enable binary buffer range validation.- Added optional extended
designproperty on all schema options. This property can be used to specify design time metadata when rendering forms.
Compiler:
- TypeBox now provides an optional experimental type compiler that can be used to validate types without AJV. This compiler is not a standard JSON schema compiler and will only compile TypeBox's known schema representations. For full JSON schema validation, AJV should still be the preference. This compiler is a work in progress.
Value:
- TypeBox now provides a value generator that can generate default values from TypeBox types.
Breaking Changes:
Type.Intersect(...)is constrained to accept types ofTObjectonly.Type.Namespace(...)has been removed.- The types
TUnion,TEnum,KeyOfandTLiteral<TString>[]are all now expressed viaallOf. For Open API users, Please considerType.Unsafe()to expressenumstring union representations. Documentation on usingType.Unsafe()can be found here