fast-json-stringify 1.15.3 → 1.15.4

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.
@@ -23,25 +23,25 @@ function buildTest (schema, toStringify) {
23
23
  }
24
24
 
25
25
  buildTest({
26
- 'title': 'basic',
27
- 'type': 'object',
28
- 'properties': {
29
- 'firstName': {
30
- 'type': 'string'
26
+ title: 'basic',
27
+ type: 'object',
28
+ properties: {
29
+ firstName: {
30
+ type: 'string'
31
31
  },
32
- 'lastName': {
33
- 'type': 'string'
32
+ lastName: {
33
+ type: 'string'
34
34
  },
35
- 'age': {
36
- 'description': 'Age in years',
37
- 'type': 'integer',
38
- 'minimum': 0
35
+ age: {
36
+ description: 'Age in years',
37
+ type: 'integer',
38
+ minimum: 0
39
39
  },
40
- 'magic': {
41
- 'type': 'number'
40
+ magic: {
41
+ type: 'number'
42
42
  }
43
43
  },
44
- 'required': ['firstName', 'lastName']
44
+ required: ['firstName', 'lastName']
45
45
  }, {
46
46
  firstName: 'Matteo',
47
47
  lastName: 'Collina',
@@ -85,21 +85,21 @@ buildTest({
85
85
  }, 42.42)
86
86
 
87
87
  buildTest({
88
- 'title': 'deep',
89
- 'type': 'object',
90
- 'properties': {
91
- 'firstName': {
92
- 'type': 'string'
88
+ title: 'deep',
89
+ type: 'object',
90
+ properties: {
91
+ firstName: {
92
+ type: 'string'
93
93
  },
94
- 'lastName': {
95
- 'type': 'string'
94
+ lastName: {
95
+ type: 'string'
96
96
  },
97
- 'more': {
98
- 'description': 'more properties',
99
- 'type': 'object',
100
- 'properties': {
101
- 'something': {
102
- 'type': 'string'
97
+ more: {
98
+ description: 'more properties',
99
+ type: 'object',
100
+ properties: {
101
+ something: {
102
+ type: 'string'
103
103
  }
104
104
  }
105
105
  }
@@ -113,16 +113,16 @@ buildTest({
113
113
  })
114
114
 
115
115
  buildTest({
116
- 'title': 'null',
117
- 'type': 'null'
116
+ title: 'null',
117
+ type: 'null'
118
118
  }, null)
119
119
 
120
120
  buildTest({
121
- 'title': 'deep object with weird keys',
122
- 'type': 'object',
123
- 'properties': {
121
+ title: 'deep object with weird keys',
122
+ type: 'object',
123
+ properties: {
124
124
  '@version': {
125
- 'type': 'integer'
125
+ type: 'integer'
126
126
  }
127
127
  }
128
128
  }, {
@@ -130,30 +130,30 @@ buildTest({
130
130
  })
131
131
 
132
132
  buildTest({
133
- 'title': 'deep object with spaces in key',
134
- 'type': 'object',
135
- 'properties': {
133
+ title: 'deep object with spaces in key',
134
+ type: 'object',
135
+ properties: {
136
136
  'spaces in key': {
137
- 'type': 'object',
138
- 'properties': {
139
- 'something': {
140
- 'type': 'integer'
137
+ type: 'object',
138
+ properties: {
139
+ something: {
140
+ type: 'integer'
141
141
  }
142
142
  }
143
143
  }
144
144
  }
145
145
  }, {
146
146
  'spaces in key': {
147
- 'something': 1
147
+ something: 1
148
148
  }
149
149
  })
150
150
 
151
151
  buildTest({
152
- 'title': 'with null',
153
- 'type': 'object',
154
- 'properties': {
155
- 'firstName': {
156
- 'type': 'null'
152
+ title: 'with null',
153
+ type: 'object',
154
+ properties: {
155
+ firstName: {
156
+ type: 'null'
157
157
  }
158
158
  }
159
159
  }, {
@@ -161,13 +161,13 @@ buildTest({
161
161
  })
162
162
 
163
163
  buildTest({
164
- 'title': 'array with objects',
165
- 'type': 'array',
166
- 'items': {
167
- 'type': 'object',
168
- 'properties': {
169
- 'name': {
170
- 'type': 'string'
164
+ title: 'array with objects',
165
+ type: 'array',
166
+ items: {
167
+ type: 'object',
168
+ properties: {
169
+ name: {
170
+ type: 'string'
171
171
  }
172
172
  }
173
173
  }
@@ -178,10 +178,10 @@ buildTest({
178
178
  }])
179
179
 
180
180
  buildTest({
181
- 'title': 'array with strings',
182
- 'type': 'array',
183
- 'items': {
184
- 'type': 'string'
181
+ title: 'array with strings',
182
+ type: 'array',
183
+ items: {
184
+ type: 'string'
185
185
  }
186
186
  }, [
187
187
  'Matteo',
@@ -189,10 +189,10 @@ buildTest({
189
189
  ])
190
190
 
191
191
  buildTest({
192
- 'title': 'array with numbers',
193
- 'type': 'array',
194
- 'items': {
195
- 'type': 'number'
192
+ title: 'array with numbers',
193
+ type: 'array',
194
+ items: {
195
+ type: 'number'
196
196
  }
197
197
  }, [
198
198
  42.42,
@@ -200,10 +200,10 @@ buildTest({
200
200
  ])
201
201
 
202
202
  buildTest({
203
- 'title': 'array with integers',
204
- 'type': 'array',
205
- 'items': {
206
- 'type': 'number'
203
+ title: 'array with integers',
204
+ type: 'array',
205
+ items: {
206
+ type: 'number'
207
207
  }
208
208
  }, [
209
209
  42,
@@ -211,16 +211,16 @@ buildTest({
211
211
  ])
212
212
 
213
213
  buildTest({
214
- 'title': 'nested array with objects',
215
- 'type': 'object',
216
- 'properties': {
217
- 'data': {
218
- 'type': 'array',
219
- 'items': {
220
- 'type': 'object',
221
- 'properties': {
222
- 'name': {
223
- 'type': 'string'
214
+ title: 'nested array with objects',
215
+ type: 'object',
216
+ properties: {
217
+ data: {
218
+ type: 'array',
219
+ items: {
220
+ type: 'object',
221
+ properties: {
222
+ name: {
223
+ type: 'string'
224
224
  }
225
225
  }
226
226
  }
@@ -235,11 +235,11 @@ buildTest({
235
235
  })
236
236
 
237
237
  buildTest({
238
- 'title': 'object with boolean',
239
- 'type': 'object',
240
- 'properties': {
241
- 'readonly': {
242
- 'type': 'boolean'
238
+ title: 'object with boolean',
239
+ type: 'object',
240
+ properties: {
241
+ readonly: {
242
+ type: 'boolean'
243
243
  }
244
244
  }
245
245
  }, {
@@ -248,14 +248,14 @@ buildTest({
248
248
 
249
249
  test('skip or coerce numbers and integers that are not numbers', (t) => {
250
250
  const stringify = build({
251
- 'title': 'basic',
252
- 'type': 'object',
253
- 'properties': {
254
- 'age': {
255
- 'type': 'number'
251
+ title: 'basic',
252
+ type: 'object',
253
+ properties: {
254
+ age: {
255
+ type: 'number'
256
256
  },
257
- 'distance': {
258
- 'type': 'integer'
257
+ distance: {
258
+ type: 'integer'
259
259
  }
260
260
  }
261
261
  })
@@ -19,26 +19,26 @@ function buildTest (schema, toStringify, expected) {
19
19
  }
20
20
 
21
21
  buildTest({
22
- 'title': 'default string',
23
- 'type': 'object',
24
- 'properties': {
25
- 'firstName': {
26
- 'type': 'string'
22
+ title: 'default string',
23
+ type: 'object',
24
+ properties: {
25
+ firstName: {
26
+ type: 'string'
27
27
  },
28
- 'lastName': {
29
- 'type': 'string',
28
+ lastName: {
29
+ type: 'string',
30
30
  default: 'Collina'
31
31
  },
32
- 'age': {
33
- 'description': 'Age in years',
34
- 'type': 'integer',
35
- 'minimum': 0
32
+ age: {
33
+ description: 'Age in years',
34
+ type: 'integer',
35
+ minimum: 0
36
36
  },
37
- 'magic': {
38
- 'type': 'number'
37
+ magic: {
38
+ type: 'number'
39
39
  }
40
40
  },
41
- 'required': ['firstName', 'lastName']
41
+ required: ['firstName', 'lastName']
42
42
  }, {
43
43
  firstName: 'Matteo',
44
44
  magic: 42,
@@ -51,26 +51,26 @@ buildTest({
51
51
  })
52
52
 
53
53
  buildTest({
54
- 'title': 'default string with value',
55
- 'type': 'object',
56
- 'properties': {
57
- 'firstName': {
58
- 'type': 'string'
54
+ title: 'default string with value',
55
+ type: 'object',
56
+ properties: {
57
+ firstName: {
58
+ type: 'string'
59
59
  },
60
- 'lastName': {
61
- 'type': 'string',
60
+ lastName: {
61
+ type: 'string',
62
62
  default: 'Collina'
63
63
  },
64
- 'age': {
65
- 'description': 'Age in years',
66
- 'type': 'integer',
67
- 'minimum': 0
64
+ age: {
65
+ description: 'Age in years',
66
+ type: 'integer',
67
+ minimum: 0
68
68
  },
69
- 'magic': {
70
- 'type': 'number'
69
+ magic: {
70
+ type: 'number'
71
71
  }
72
72
  },
73
- 'required': ['firstName', 'lastName']
73
+ required: ['firstName', 'lastName']
74
74
  }, {
75
75
  firstName: 'Matteo',
76
76
  lastName: 'collina',
@@ -84,26 +84,26 @@ buildTest({
84
84
  })
85
85
 
86
86
  buildTest({
87
- 'title': 'default number',
88
- 'type': 'object',
89
- 'properties': {
90
- 'firstName': {
91
- 'type': 'string'
87
+ title: 'default number',
88
+ type: 'object',
89
+ properties: {
90
+ firstName: {
91
+ type: 'string'
92
92
  },
93
- 'lastName': {
94
- 'type': 'string'
93
+ lastName: {
94
+ type: 'string'
95
95
  },
96
- 'age': {
97
- 'description': 'Age in years',
98
- 'type': 'integer',
99
- 'minimum': 0
96
+ age: {
97
+ description: 'Age in years',
98
+ type: 'integer',
99
+ minimum: 0
100
100
  },
101
- 'magic': {
102
- 'type': 'number',
101
+ magic: {
102
+ type: 'number',
103
103
  default: 42
104
104
  }
105
105
  },
106
- 'required': ['firstName', 'lastName']
106
+ required: ['firstName', 'lastName']
107
107
  }, {
108
108
  firstName: 'Matteo',
109
109
  lastName: 'Collina',
@@ -116,26 +116,26 @@ buildTest({
116
116
  })
117
117
 
118
118
  buildTest({
119
- 'title': 'default number with value',
120
- 'type': 'object',
121
- 'properties': {
122
- 'firstName': {
123
- 'type': 'string'
119
+ title: 'default number with value',
120
+ type: 'object',
121
+ properties: {
122
+ firstName: {
123
+ type: 'string'
124
124
  },
125
- 'lastName': {
126
- 'type': 'string'
125
+ lastName: {
126
+ type: 'string'
127
127
  },
128
- 'age': {
129
- 'description': 'Age in years',
130
- 'type': 'integer',
131
- 'minimum': 0
128
+ age: {
129
+ description: 'Age in years',
130
+ type: 'integer',
131
+ minimum: 0
132
132
  },
133
- 'magic': {
134
- 'type': 'number',
133
+ magic: {
134
+ type: 'number',
135
135
  default: 42
136
136
  }
137
137
  },
138
- 'required': ['firstName', 'lastName']
138
+ required: ['firstName', 'lastName']
139
139
  }, {
140
140
  firstName: 'Matteo',
141
141
  lastName: 'Collina',
@@ -149,26 +149,26 @@ buildTest({
149
149
  })
150
150
 
151
151
  buildTest({
152
- 'title': 'default object',
153
- 'type': 'object',
154
- 'properties': {
155
- 'firstName': {
156
- 'type': 'string'
152
+ title: 'default object',
153
+ type: 'object',
154
+ properties: {
155
+ firstName: {
156
+ type: 'string'
157
157
  },
158
- 'lastName': {
159
- 'type': 'string'
158
+ lastName: {
159
+ type: 'string'
160
160
  },
161
- 'age': {
162
- 'description': 'Age in years',
163
- 'type': 'integer',
164
- 'minimum': 0
161
+ age: {
162
+ description: 'Age in years',
163
+ type: 'integer',
164
+ minimum: 0
165
165
  },
166
- 'otherProps': {
167
- 'type': 'object',
166
+ otherProps: {
167
+ type: 'object',
168
168
  default: { foo: 'bar' }
169
169
  }
170
170
  },
171
- 'required': ['firstName', 'lastName']
171
+ required: ['firstName', 'lastName']
172
172
  }, {
173
173
  firstName: 'Matteo',
174
174
  lastName: 'Collina',
@@ -181,27 +181,27 @@ buildTest({
181
181
  })
182
182
 
183
183
  buildTest({
184
- 'title': 'default object with value',
185
- 'type': 'object',
186
- 'properties': {
187
- 'firstName': {
188
- 'type': 'string'
184
+ title: 'default object with value',
185
+ type: 'object',
186
+ properties: {
187
+ firstName: {
188
+ type: 'string'
189
189
  },
190
- 'lastName': {
191
- 'type': 'string'
190
+ lastName: {
191
+ type: 'string'
192
192
  },
193
- 'age': {
194
- 'description': 'Age in years',
195
- 'type': 'integer',
196
- 'minimum': 0
193
+ age: {
194
+ description: 'Age in years',
195
+ type: 'integer',
196
+ minimum: 0
197
197
  },
198
- 'otherProps': {
199
- 'type': 'object',
198
+ otherProps: {
199
+ type: 'object',
200
200
  additionalProperties: true,
201
201
  default: { foo: 'bar' }
202
202
  }
203
203
  },
204
- 'required': ['firstName', 'lastName']
204
+ required: ['firstName', 'lastName']
205
205
  }, {
206
206
  firstName: 'Matteo',
207
207
  lastName: 'Collina',
@@ -215,27 +215,27 @@ buildTest({
215
215
  })
216
216
 
217
217
  buildTest({
218
- 'title': 'default array',
219
- 'type': 'object',
220
- 'properties': {
221
- 'firstName': {
222
- 'type': 'string'
218
+ title: 'default array',
219
+ type: 'object',
220
+ properties: {
221
+ firstName: {
222
+ type: 'string'
223
223
  },
224
- 'lastName': {
225
- 'type': 'string'
224
+ lastName: {
225
+ type: 'string'
226
226
  },
227
- 'age': {
228
- 'description': 'Age in years',
229
- 'type': 'integer',
230
- 'minimum': 0
227
+ age: {
228
+ description: 'Age in years',
229
+ type: 'integer',
230
+ minimum: 0
231
231
  },
232
- 'otherProps': {
233
- 'type': 'array',
232
+ otherProps: {
233
+ type: 'array',
234
234
  items: { type: 'string' },
235
235
  default: ['FOO']
236
236
  }
237
237
  },
238
- 'required': ['firstName', 'lastName']
238
+ required: ['firstName', 'lastName']
239
239
  }, {
240
240
  firstName: 'Matteo',
241
241
  lastName: 'Collina',
@@ -248,27 +248,27 @@ buildTest({
248
248
  })
249
249
 
250
250
  buildTest({
251
- 'title': 'default array with value',
252
- 'type': 'object',
253
- 'properties': {
254
- 'firstName': {
255
- 'type': 'string'
251
+ title: 'default array with value',
252
+ type: 'object',
253
+ properties: {
254
+ firstName: {
255
+ type: 'string'
256
256
  },
257
- 'lastName': {
258
- 'type': 'string'
257
+ lastName: {
258
+ type: 'string'
259
259
  },
260
- 'age': {
261
- 'description': 'Age in years',
262
- 'type': 'integer',
263
- 'minimum': 0
260
+ age: {
261
+ description: 'Age in years',
262
+ type: 'integer',
263
+ minimum: 0
264
264
  },
265
- 'otherProps': {
266
- 'type': 'array',
265
+ otherProps: {
266
+ type: 'array',
267
267
  items: { type: 'string' },
268
268
  default: ['FOO']
269
269
  }
270
270
  },
271
- 'required': ['firstName', 'lastName']
271
+ required: ['firstName', 'lastName']
272
272
  }, {
273
273
  firstName: 'Matteo',
274
274
  lastName: 'Collina',
@@ -282,21 +282,21 @@ buildTest({
282
282
  })
283
283
 
284
284
  buildTest({
285
- 'title': 'default deeper value',
286
- 'type': 'object',
287
- 'properties': {
288
- 'level1': {
289
- 'type': 'object',
290
- 'properties': {
291
- 'level2': {
292
- 'type': 'object',
293
- 'properties': {
294
- 'level3': {
295
- 'type': 'object',
296
- 'properties': {
297
- 'level4': {
298
- 'type': 'object',
299
- 'default': { 'foo': 'bar' }
285
+ title: 'default deeper value',
286
+ type: 'object',
287
+ properties: {
288
+ level1: {
289
+ type: 'object',
290
+ properties: {
291
+ level2: {
292
+ type: 'object',
293
+ properties: {
294
+ level3: {
295
+ type: 'object',
296
+ properties: {
297
+ level4: {
298
+ type: 'object',
299
+ default: { foo: 'bar' }
300
300
  }
301
301
  }
302
302
  }
@@ -312,21 +312,21 @@ buildTest({
312
312
  })
313
313
 
314
314
  buildTest({
315
- 'title': 'default deeper value with value',
316
- 'type': 'object',
317
- 'properties': {
318
- 'level1': {
319
- 'type': 'object',
320
- 'properties': {
321
- 'level2': {
322
- 'type': 'object',
323
- 'properties': {
324
- 'level3': {
325
- 'type': 'object',
326
- 'properties': {
327
- 'level4': {
328
- 'type': 'object',
329
- 'default': { 'foo': 'bar' }
315
+ title: 'default deeper value with value',
316
+ type: 'object',
317
+ properties: {
318
+ level1: {
319
+ type: 'object',
320
+ properties: {
321
+ level2: {
322
+ type: 'object',
323
+ properties: {
324
+ level3: {
325
+ type: 'object',
326
+ properties: {
327
+ level4: {
328
+ type: 'object',
329
+ default: { foo: 'bar' }
330
330
  }
331
331
  }
332
332
  }