deno.land / x / typebox@0.32.21 / changelog / 0.24.44.md
Updates:
Value.Error(T, value) and TypeCheck.Error(value) now return an iterator for validation errors.TypeGuard API that can be used to check the structural validity of TypeBox type. The TypeGuard can be used in reflection / code generation scenarios to resolve the appropriate inner TSchema type while traversing a outer type.0.24.0 release but may be provided as standard type in later releases. This API enables type T = Foo extends Bar ? true : false conditional checks to be implemented at runtime. This API also provides the Exclude and Extract utility types which are implemented through conditional types in TypeScript.Tuple types.TPick and TOmit now support types of TUnion<TLiteral<string>[]> to be used to select properties. Additionally, KeyOf now returns TUnion<TLiteral<string>[]>, allowing KeyOf schemas to be passed to TPick and TOmit.ValueError type. These codes can be used by external implementers to create localized error messages. TypeBox may include localized error codes as an optional import in future releases.Value and TypeCompiler API's. TypeBox does not currently provide any built in formats, however the standard expected set (email, uuid, uri, etc) may be provided via optional import (inline with ajv-formats usage)Value.Cast() function now implements automatic coercion of string, number and Boolean types.Value.Diff<T>() and Value.Patch<T>() utility API for JavaScript values. This API is intended to provide a basis for the efficient transmission of state updates across a network. This API can diff any JavaScript value (typed or untyped) but is recommended to be used in conjunction with a formal static type.TNever type. This type is analogous to TypeScript's never type and is used in instances a composition results in a non-reconcilable type. Currently this type is implemented for empty TUnion<[]> types only. Future releases may utilize this type for planned updates to TIntersect (for example string & number resolves to never)Value.Diff() and Value.Patch() functions but is now offered as an optional import for implementations that need to update values manually through pointer references.Additional:
TypeScriptCodeGen which will remap TypeScript interface and type definitions to TypeBox types. The second is TypeBoxCodeGen which will map existing TypeBox types into TypeScript type definitions. These implementations are not expected to be part of the TypeBox package, but users are free to clone and enhance them in their existing tool chains. Reference implementations can be found https://github.com/sinclairzx81/typebox/tree/master/codegenVersion Info