Skip to content

Commit 57f5c7f

Browse files
authored
chore: add oneOf to docs (#377)
1 parent b029fb2 commit 57f5c7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ compile-json-stringify date format x 1,086,187 ops/sec ±0.16% (99 runs sampled)
5656
- <a href="#missingFields">`Missing fields`</a>
5757
- <a href="#patternProperties">`Pattern Properties`</a>
5858
- <a href="#additionalProperties">`Additional Properties`</a>
59-
- <a href="#anyof">`AnyOf`</a>
59+
- <a href="#anyof">`AnyOf` and `OneOf`</a>
6060
- <a href="#ref">`Reuse - $ref`</a>
6161
- <a href="#long">`Long integers`</a>
6262
- <a href="#integer">`Integers`</a>
@@ -320,11 +320,11 @@ const obj = {
320320
console.log(stringify(obj)) // '{"nickname":"nick","matchfoo":"42","otherfoo":"str","matchnum":3,"nomatchstr":"valar morghulis",nomatchint:"313"}'
321321
```
322322

323-
#### AnyOf
323+
#### AnyOf and OneOf
324324

325-
`fast-json-stringify` supports the anyOf keyword as defined by JSON schema. *anyOf* must be an array of valid JSON schemas. The different schemas will be tested in the specified order. The more schemas `stringify` has to try before finding a match, the slower it will be.
325+
`fast-json-stringify` supports the **anyOf** and **oneOf** keywords as defined by JSON schema. Both must be an array of valid JSON schemas. The different schemas will be tested in the specified order. The more schemas `stringify` has to try before finding a match, the slower it will be.
326326

327-
*anyOf* uses [ajv](https://www.npmjs.com/package/ajv) as a JSON schema validator to find the schema that matches the data. This has an impact on performance—only use it as a last resort.
327+
*anyOf* and *oneOf* use [ajv](https://www.npmjs.com/package/ajv) as a JSON schema validator to find the schema that matches the data. This has an impact on performance—only use it as a last resort.
328328

329329
Example:
330330
```javascript

0 commit comments

Comments
 (0)