fast-json-stringify 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +1 -1
- package/README.md +4 -4
- package/package.json +1 -1
package/.github/workflows/ci.yml
CHANGED
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ compile-json-stringify date format x 1,086,187 ops/sec ±0.16% (99 runs sampled)
|
|
|
56
56
|
- <a href="#missingFields">`Missing fields`</a>
|
|
57
57
|
- <a href="#patternProperties">`Pattern Properties`</a>
|
|
58
58
|
- <a href="#additionalProperties">`Additional Properties`</a>
|
|
59
|
-
- <a href="#anyof">`AnyOf`</a>
|
|
59
|
+
- <a href="#anyof">`AnyOf` and `OneOf`</a>
|
|
60
60
|
- <a href="#ref">`Reuse - $ref`</a>
|
|
61
61
|
- <a href="#long">`Long integers`</a>
|
|
62
62
|
- <a href="#integer">`Integers`</a>
|
|
@@ -320,11 +320,11 @@ const obj = {
|
|
|
320
320
|
console.log(stringify(obj)) // '{"nickname":"nick","matchfoo":"42","otherfoo":"str","matchnum":3,"nomatchstr":"valar morghulis",nomatchint:"313"}'
|
|
321
321
|
```
|
|
322
322
|
|
|
323
|
-
#### AnyOf
|
|
323
|
+
#### AnyOf and OneOf
|
|
324
324
|
|
|
325
|
-
`fast-json-stringify` supports the anyOf
|
|
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.
|
|
326
326
|
|
|
327
|
-
*anyOf*
|
|
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.
|
|
328
328
|
|
|
329
329
|
Example:
|
|
330
330
|
```javascript
|