This commit is contained in:
sinclair
2025-12-24 15:44:34 +09:00
commit 13d553220c
1047 changed files with 80931 additions and 0 deletions

20
changelog/0.24.6.md Normal file
View File

@@ -0,0 +1,20 @@
## [0.24.6](https://www.npmjs.com/package/@sinclair/typebox/v/0.24.6)
Added:
- TypeBox now offers a `TypeGuard` module for structurally checking TypeBox schematics. This module can be used in runtime type reflection scenarios where it's helpful to test a schema is of a particular form. This module can be imported under the `@sinclair/typebox/guard` import path.
Example:
```typescript
import { TypeGuard } from '@sinclair/typebox/guard'
const T: any = {} // T is any
const { type } = T // unsafe: type is any
if(TypeGuard.IsString(T)) {
const { type } = T // safe: type is 'string'
}
```