Skip to content

Commit d632539

Browse files
authoredJan 15, 2022
Update getting-started.md (#1871)
Minor spelling and grammar corrections.
1 parent 418cd0f commit d632539

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎docs/guide/getting-started.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ See [Contributing](../CONTRIBUTING.md) on how to run the tests locally
2525
## Basic data validation
2626

2727
Ajv takes a schema for your JSON data and converts it into a very efficient JavaScript code
28-
that validates your data according to the schema. To create schema you can use either
28+
that validates your data according to the schema. To create a schema you can use either
2929
[JSON Schema](../json-schema) or [JSON Type Definition](../json-type-definition) - check out [Choosing schema language](./schema-language), they have
3030
different advantages and disadvantages.
3131

@@ -87,7 +87,7 @@ if (!valid) console.log(validate.errors)
8787
</code-block>
8888
</code-group>
8989

90-
Ajv compiles schemas to functions and caches them in all cases (using schema itself as a key for Map), so that the next time the same schema object is used it won't be compiled again.
90+
Ajv compiles schemas to functions and caches them in all cases (using the schema itself as a key in a Map), so that the next time the same schema object is used it won't be compiled again.
9191

9292
::: tip Best performance: compile and getSchema methods
9393
The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods.
@@ -98,7 +98,7 @@ re-use compiled validation functions. See [Managing multiple schemas](./managing
9898
:::
9999

100100
::: warning Save errors property
101-
Every time a validation function (or `ajv.validate`) is called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](../api.md#validation-errors)
101+
Every time a validation function (or `ajv.validate`) is called the `errors` property is overwritten. You need to copy the `errors` array reference to another variable if you want to use it later (e.g. in the callback). See [Validation errors](../api.md#validation-errors).
102102
:::
103103

104104
## Parsing and serializing JSON <Badge text="New" />
@@ -107,7 +107,7 @@ Ajv can compile efficient parsers and serializers from [JSON Type Definition](..
107107

108108
Serializing the data with a function specialized to your data shape can be more than 10x compared with `JSON.stringify`.
109109

110-
Parsing the data replaces the need for a separate validation after generic parsing with `JSON.parse` (although validation itself is usually much faster than parsing). In case your JSON string is valid specialized parsing is approximately as fast as JSON.parse, but in case your JSON is invalid, specialized parsing would fail much faster - so it can be very efficient in some scenarios.
110+
Parsing the data replaces the need for separate validation after generic parsing with `JSON.parse` (although validation itself is usually much faster than parsing). In case your JSON string is valid, the specialized parsing is approximately as fast as JSON.parse, but in case your JSON is invalid, the specialized parsing would fail much faster - so it can be very efficient in some scenarios.
111111

112112
For the same data structure, you can compile parser and serializer in this way:
113113

0 commit comments

Comments
 (0)
Please sign in to comment.