sinclairzx81 / typebox

Json Schema Type Builder with Static Type Resolution for TypeScript
Other
4.65k stars 150 forks source link

Revision 0.32.25 #849

Closed sinclairzx81 closed 3 months ago

sinclairzx81 commented 3 months ago

This PR implements library wide optimizations to improve type composition performance (faster startup) as well as optimizations to Value functions (with particular note to Decode and Encode). The update employs a new strategy to avoid unnecessary object initialization when constructing schematics, and also adds a new KindGuard which offers a fast path for type differentiation during composition.

These updates were made to improve composition performance specifically for Indexed, Composite, KeyOf and Mapped functions.

Additional updates include general code maintenance which primarily centered on the adoption of the as never return pattern over explicit type return.

This PR has no breaking changes.