Documentation (#436)

This commit is contained in:
Erfan Safari
2023-05-17 12:25:04 +03:30
committed by GitHub
parent 41dae20a28
commit 81724d1a72
+1 -1
View File
@@ -1277,7 +1277,7 @@ The TypeCompiler is provided as an optional import.
import { TypeCompiler } from '@sinclair/typebox/compiler'
```
Use the `Compile(...)` function to compile a type.
Use the `Compile(...)` function to compile a type. Note that compilation is an expensive operation that should typically be performed once per type during application start up. TypeBox does not cache previously compiled types, so applications are expected to hold references to each compiled type for the lifetime of the application.
```typescript
const C = TypeCompiler.Compile(Type.Object({ // const C: TypeCheck<TObject<{