fast-json-stringify 2.7.12 → 2.7.13

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.
@@ -2,6 +2,10 @@ version: 2
2
2
  updates:
3
3
  - package-ecosystem: github-actions
4
4
  directory: '/'
5
+ ignore:
6
+ - dependency-name: "actions/*"
7
+ update-types:
8
+ ["version-update:semver-minor", "version-update:semver-patch"]
5
9
  schedule:
6
10
  interval: daily
7
11
  open-pull-requests-limit: 10
@@ -19,10 +19,10 @@ jobs:
19
19
  os: [macos-latest, ubuntu-latest, windows-latest]
20
20
 
21
21
  steps:
22
- - uses: actions/checkout@v2.3.4
22
+ - uses: actions/checkout@v2
23
23
 
24
24
  - name: Use Node.js
25
- uses: actions/setup-node@v2.4.0
25
+ uses: actions/setup-node@v2
26
26
  with:
27
27
  node-version: ${{ matrix.node-version }}
28
28
 
@@ -38,6 +38,6 @@ jobs:
38
38
  needs: test
39
39
  runs-on: ubuntu-latest
40
40
  steps:
41
- - uses: fastify/github-action-merge-dependabot@v2.5.0
41
+ - uses: fastify/github-action-merge-dependabot@v2.7.1
42
42
  with:
43
43
  github-token: ${{ secrets.GITHUB_TOKEN }}
package/index.js CHANGED
@@ -819,6 +819,12 @@ function buildCode (location, code, laterCode, name) {
819
819
  `
820
820
  }
821
821
 
822
+ if (schema.allOf) {
823
+ const builtCode = buildCodeWithAllOfs(location, code, laterCode, name)
824
+ code = builtCode.code
825
+ laterCode = builtCode.laterCode
826
+ }
827
+
822
828
  return { code: code, laterCode: laterCode }
823
829
  }
824
830
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-json-stringify",
3
- "version": "2.7.12",
3
+ "version": "2.7.13",
4
4
  "description": "Stringify your JSON at max speed",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -277,6 +277,58 @@ test('object with multiple $refs in allOf', (t) => {
277
277
  t.equal(value, '{"id1":1,"id2":2}')
278
278
  })
279
279
 
280
+ test('allOf with nested allOf in $ref', (t) => {
281
+ t.plan(1)
282
+
283
+ const schema = {
284
+ title: 'allOf with nested allOf in $ref',
285
+ type: 'object',
286
+ definitions: {
287
+ group: {
288
+ type: 'object',
289
+ allOf: [{
290
+ properties: {
291
+ id2: {
292
+ type: 'integer'
293
+ }
294
+ }
295
+ }, {
296
+ properties: {
297
+ id3: {
298
+ type: 'integer'
299
+ }
300
+ }
301
+ }]
302
+ }
303
+ },
304
+ allOf: [
305
+ {
306
+ type: 'object',
307
+ properties: {
308
+ id1: {
309
+ type: 'integer'
310
+ }
311
+ },
312
+ required: [
313
+ 'id1'
314
+ ]
315
+ },
316
+ {
317
+ $ref: '#/definitions/group'
318
+ }
319
+ ]
320
+ }
321
+
322
+ const stringify = build(schema)
323
+ const value = stringify({
324
+ id1: 1,
325
+ id2: 2,
326
+ id3: 3,
327
+ id4: 4 // extra prop shouldn't be in result
328
+ })
329
+ t.equal(value, '{"id1":1,"id2":2,"id3":3}')
330
+ })
331
+
280
332
  test('object with external $refs in allOf', (t) => {
281
333
  t.plan(1)
282
334