fast-json-stringify 5.0.4 → 5.0.5

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/index.js CHANGED
@@ -493,6 +493,7 @@ function mergeAllOfSchema (location, schema, mergedSchema) {
493
493
  mergedSchema.$id = `merged_${randomUUID()}`
494
494
  ajvInstance.addSchema(mergedSchema)
495
495
  location.schemaId = mergedSchema.$id
496
+ location.jsonPointer = '#'
496
497
  }
497
498
 
498
499
  function buildInnerObject (location) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-json-stringify",
3
- "version": "5.0.4",
3
+ "version": "5.0.5",
4
4
  "description": "Stringify your JSON at max speed",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/test/ref.test.js CHANGED
@@ -1891,3 +1891,38 @@ test('input schema is not mutated', (t) => {
1891
1891
  t.equal(output, '{"obj":"test"}')
1892
1892
  t.same(schema, clonedSchema)
1893
1893
  })
1894
+
1895
+ test('anyOf inside allOf', (t) => {
1896
+ t.plan(1)
1897
+
1898
+ const schema = {
1899
+ anyOf: [
1900
+ {
1901
+ type: 'object',
1902
+ allOf: [
1903
+ {
1904
+ properties: {
1905
+ a: {
1906
+ anyOf: [
1907
+ { const: 'A1' },
1908
+ { const: 'A2' }
1909
+ ]
1910
+ }
1911
+ }
1912
+ },
1913
+ {
1914
+ properties: {
1915
+ b: { const: 'B' }
1916
+ }
1917
+ }
1918
+ ]
1919
+ }
1920
+ ]
1921
+ }
1922
+
1923
+ const object = { a: 'A1', b: 'B' }
1924
+ const stringify = build(schema)
1925
+ const output = stringify(object)
1926
+
1927
+ t.equal(output, JSON.stringify(object))
1928
+ })