Skip to content

Commit

Permalink
Update typescript.md (#1661)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskfyi authored Jun 30, 2021
1 parent f870838 commit c739c1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/guide/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const schema: JSONSchemaType<MyData> = {
type: "object",
properties: {
foo: {type: "integer"},
bar: {type: "string", nullable: "true"}
bar: {type: "string", nullable: true}
},
required: ["foo"],
additionalProperties: false
Expand All @@ -45,7 +45,7 @@ const validate = ajv.compile(schema)
// type parameter can be used to make it type guard:
// const validate = ajv.compile<MyData>(schema)

const validData = {
const data = {
foo: 1,
bar: "abc"
}
Expand Down Expand Up @@ -86,7 +86,7 @@ const validate = ajv.compile(schema)
// type parameter can be used to make it type guard:
// const validate = ajv.compile<MyData>(schema)

const validData = {
const data = {
foo: 1,
bar: "abc"
}
Expand Down

0 comments on commit c739c1e

Please sign in to comment.