Skip to content

Commit

Permalink
docs: add code block header
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Mar 6, 2021
1 parent 848d3f2 commit 23293be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/guide/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ See [this test](https://github.com/ajv-validator/ajv/tree/master/spec/types/json

You can use JTD schema to construct the type of data using utility type `JTDDataType`

<code-group>
<code-block title="JSON Type Definition">
```typescript
import Ajv, {JTDDataType} from "ajv/dist/jtd"
const ajv = new Ajv()
Expand Down Expand Up @@ -136,6 +138,8 @@ if (validate(data)) {
console.log(validate.errors)
}
```
</code-block>
</code-group>

## Type-safe error handling

Expand Down

0 comments on commit 23293be

Please sign in to comment.