deno.land / x / typebox@0.32.21 / changelog / 0.24.6.md
Added:
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:
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'
}
Version Info