mirror of
https://github.com/zoriya/typebox.git
synced 2025-12-06 06:46:10 +00:00
1.3 KiB
1.3 KiB
0.18.0
Changes:
- Function
Type.Intersect(...)is now implemented withallOfand constrained withunevaluatedProperties(draft2019-09) - Function
Type.Dict(...)has been deprecated and replaced withType.Record(...). - Function
Type.Strict(...)now includes the$schemaproperty referencing the2019-09draft.
Type.Intersect(...)
TypeBox now targets JSON schema draft 2019-09 for expressing Type.Intersect(...). This is now expressed via allOf with additionalProperties constrained with unevaluatedProperties. Note that unevaluatedProperties is a feature of the 2019-09 specification.
Type.Record(K, V)
TypeBox has deprecated Type.Dict(...) in favor of the more generic Type.Record(...). Where as Type.Dict(...) was previously expressed with additionalProperties: { ... }, Type.Record(...) is expressed with patternProperties and supports both string and number indexer keys. Additionally, Type.Record(...) supports string union arguments. This is analogous to TypeScript's utility record type Record<'a' | 'b' | 'c', T>.
0.17.7
Changes:
- Added optional
$idargument onType.Rec(). - Documentation updates.