@litert/typeguard 1.3.0-dev.0 → 1.4.0

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.
Files changed (61) hide show
  1. package/CHANGES.md +7 -1
  2. package/lib/BuiltInTypeCompiler.d.ts +1 -1
  3. package/lib/BuiltInTypeCompiler.js +4 -4
  4. package/lib/BuiltInTypeCompiler.js.map +1 -1
  5. package/lib/BuiltInTypes.d.ts +1 -1
  6. package/lib/BuiltInTypes.js +1 -1
  7. package/lib/Common.d.ts +6 -5
  8. package/lib/Common.d.ts.map +1 -1
  9. package/lib/Common.js +1 -1
  10. package/lib/Compiler.d.ts +1 -1
  11. package/lib/Compiler.d.ts.map +1 -1
  12. package/lib/Compiler.js +57 -35
  13. package/lib/Compiler.js.map +1 -1
  14. package/lib/Context.d.ts +2 -2
  15. package/lib/Context.d.ts.map +1 -1
  16. package/lib/Context.js +2 -2
  17. package/lib/Context.js.map +1 -1
  18. package/lib/FilterCompiler.d.ts +3 -3
  19. package/lib/FilterCompiler.d.ts.map +1 -1
  20. package/lib/FilterCompiler.js +4 -4
  21. package/lib/FilterCompiler.js.map +1 -1
  22. package/lib/InlineCompiler.d.ts +2 -2
  23. package/lib/InlineCompiler.d.ts.map +1 -1
  24. package/lib/InlineCompiler.js +5 -7
  25. package/lib/InlineCompiler.js.map +1 -1
  26. package/lib/Internal.d.ts +9 -4
  27. package/lib/Internal.d.ts.map +1 -1
  28. package/lib/Internal.js +45 -4
  29. package/lib/Internal.js.map +1 -1
  30. package/lib/Modifiers.d.ts +2 -1
  31. package/lib/Modifiers.d.ts.map +1 -1
  32. package/lib/Modifiers.js +3 -2
  33. package/lib/Modifiers.js.map +1 -1
  34. package/lib/index.d.ts +1 -1
  35. package/lib/index.js +1 -1
  36. package/lib/langs/JavaScript.d.ts +1 -1
  37. package/lib/langs/JavaScript.js +2 -2
  38. package/package.json +11 -13
  39. package/src/examples/quick-start.ts +5 -1
  40. package/src/lib/BuiltInTypeCompiler.ts +4 -4
  41. package/src/lib/BuiltInTypes.ts +1 -1
  42. package/src/lib/Common.ts +5 -4
  43. package/src/lib/Compiler.ts +66 -39
  44. package/src/lib/Context.ts +2 -2
  45. package/src/lib/FilterCompiler.ts +3 -3
  46. package/src/lib/InlineCompiler.ts +6 -9
  47. package/src/lib/Internal.ts +73 -4
  48. package/src/lib/Modifiers.ts +3 -1
  49. package/src/lib/index.ts +1 -1
  50. package/src/lib/langs/JavaScript.ts +2 -2
  51. package/src/test/00-all.ts +1 -1
  52. package/src/test/01-elemental-types.ts +580 -580
  53. package/src/test/02-array-and-list.ts +43 -43
  54. package/src/test/03-tuple.ts +61 -61
  55. package/src/test/04-from-string.ts +501 -501
  56. package/src/test/05-string-asserts.ts +203 -203
  57. package/src/test/06-structure.ts +71 -71
  58. package/src/test/07-modifiers.ts +297 -48
  59. package/src/test/08-map-and-dict.ts +11 -11
  60. package/src/test/09-exceptions.ts +11 -11
  61. package/src/test/abstracts.ts +57 -29
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-loss-of-precision */
2
2
  /**
3
- * Copyright 2022 Angus Fenying <fenying@litert.org>
3
+ * Copyright 2023 Angus Fenying <fenying@litert.org>
4
4
  *
5
5
  * Licensed under the Apache License, Version 2.0 (the "License");
6
6
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
15
15
  * limitations under the License.
16
16
  */
17
17
 
18
- import { createTestDefinition, defaultItemss, ITestSuite } from './abstracts';
18
+ import { createTestDefinition, defaultItems, ITestSuite } from './abstracts';
19
19
 
20
20
  const testItems: ITestSuite = {
21
21
 
@@ -27,16 +27,16 @@ const testItems: ITestSuite = {
27
27
  'rule': ['$.string', 'boolean'],
28
28
  'items': [
29
29
  {
30
- 'inputName': 'string \'true\'',
31
- 'inputValue': 'true',
30
+ 'title': 'string \'true\'',
31
+ 'value': 'true',
32
32
  'expect': true
33
33
  },
34
34
  {
35
- 'inputName': 'string \'false\'',
36
- 'inputValue': 'false',
35
+ 'title': 'string \'false\'',
36
+ 'value': 'false',
37
37
  'expect': true
38
38
  },
39
- ...defaultItemss({
39
+ ...defaultItems({
40
40
  'true': true,
41
41
  'false': true
42
42
  })
@@ -47,11 +47,11 @@ const testItems: ITestSuite = {
47
47
  'rule': ['$.string', 'true'],
48
48
  'items': [
49
49
  {
50
- 'inputName': 'string \'true\'',
51
- 'inputValue': 'true',
50
+ 'title': 'string \'true\'',
51
+ 'value': 'true',
52
52
  'expect': true
53
53
  },
54
- ...defaultItemss({
54
+ ...defaultItems({
55
55
  'true': true,
56
56
  'false': false
57
57
  })
@@ -62,11 +62,11 @@ const testItems: ITestSuite = {
62
62
  'rule': ['$.string', 'false'],
63
63
  'items': [
64
64
  {
65
- 'inputName': 'string \'false\'',
66
- 'inputValue': 'false',
65
+ 'title': 'string \'false\'',
66
+ 'value': 'false',
67
67
  'expect': true
68
68
  },
69
- ...defaultItemss({
69
+ ...defaultItems({
70
70
  'true': false,
71
71
  'false': true
72
72
  })
@@ -77,26 +77,26 @@ const testItems: ITestSuite = {
77
77
  'rule': ['$.string', 'int'],
78
78
  'items': [
79
79
  {
80
- 'inputName': 'number -1',
81
- 'inputValue': -1,
80
+ 'title': 'number -1',
81
+ 'value': -1,
82
82
  'expect': true
83
83
  },
84
84
  {
85
- 'inputName': 'string \'-1\'',
86
- 'inputValue': '-1',
85
+ 'title': 'string \'-1\'',
86
+ 'value': '-1',
87
87
  'expect': true
88
88
  },
89
89
  {
90
- 'inputName': 'string \'1.23\'',
91
- 'inputValue': '1.23',
90
+ 'title': 'string \'1.23\'',
91
+ 'value': '1.23',
92
92
  'expect': false
93
93
  },
94
94
  {
95
- 'inputName': 'number 1.23',
96
- 'inputValue': 1.23,
95
+ 'title': 'number 1.23',
96
+ 'value': 1.23,
97
97
  'expect': false
98
98
  },
99
- ...defaultItemss({
99
+ ...defaultItems({
100
100
  'number 0': true,
101
101
  'number 1': true
102
102
  })
@@ -107,56 +107,56 @@ const testItems: ITestSuite = {
107
107
  'rule': ['$.string', 'int(10,)'],
108
108
  'items': [
109
109
  {
110
- 'inputName': 'number 11',
111
- 'inputValue': 11,
110
+ 'title': 'number 11',
111
+ 'value': 11,
112
112
  'expect': true
113
113
  },
114
114
  {
115
- 'inputName': 'number 10',
116
- 'inputValue': 10,
115
+ 'title': 'number 10',
116
+ 'value': 10,
117
117
  'expect': true
118
118
  },
119
119
  {
120
- 'inputName': 'number -1',
121
- 'inputValue': -1,
120
+ 'title': 'number -1',
121
+ 'value': -1,
122
122
  'expect': false
123
123
  },
124
124
  {
125
- 'inputName': 'number 9',
126
- 'inputValue': 9,
125
+ 'title': 'number 9',
126
+ 'value': 9,
127
127
  'expect': false
128
128
  },
129
129
  {
130
- 'inputName': 'number 1.23',
131
- 'inputValue': 1.23,
130
+ 'title': 'number 1.23',
131
+ 'value': 1.23,
132
132
  'expect': false
133
133
  },
134
134
  {
135
- 'inputName': 'string \'11\'',
136
- 'inputValue': '11',
135
+ 'title': 'string \'11\'',
136
+ 'value': '11',
137
137
  'expect': true
138
138
  },
139
139
  {
140
- 'inputName': 'string \'10\'',
141
- 'inputValue': '10',
140
+ 'title': 'string \'10\'',
141
+ 'value': '10',
142
142
  'expect': true
143
143
  },
144
144
  {
145
- 'inputName': 'string \'-1\'',
146
- 'inputValue': '-1',
145
+ 'title': 'string \'-1\'',
146
+ 'value': '-1',
147
147
  'expect': false
148
148
  },
149
149
  {
150
- 'inputName': 'string \'9\'',
151
- 'inputValue': '9',
150
+ 'title': 'string \'9\'',
151
+ 'value': '9',
152
152
  'expect': false
153
153
  },
154
154
  {
155
- 'inputName': 'string \'1.23\'',
156
- 'inputValue': '1.23',
155
+ 'title': 'string \'1.23\'',
156
+ 'value': '1.23',
157
157
  'expect': false
158
158
  },
159
- ...defaultItemss({
159
+ ...defaultItems({
160
160
  'number 0': false,
161
161
  'number 1': false
162
162
  })
@@ -167,56 +167,56 @@ const testItems: ITestSuite = {
167
167
  'rule': ['$.string', 'int(,10)'],
168
168
  'items': [
169
169
  {
170
- 'inputName': 'number 11',
171
- 'inputValue': 11,
170
+ 'title': 'number 11',
171
+ 'value': 11,
172
172
  'expect': false
173
173
  },
174
174
  {
175
- 'inputName': 'number 10',
176
- 'inputValue': 10,
175
+ 'title': 'number 10',
176
+ 'value': 10,
177
177
  'expect': true
178
178
  },
179
179
  {
180
- 'inputName': 'number -1',
181
- 'inputValue': -1,
180
+ 'title': 'number -1',
181
+ 'value': -1,
182
182
  'expect': true
183
183
  },
184
184
  {
185
- 'inputName': 'number 9',
186
- 'inputValue': 9,
185
+ 'title': 'number 9',
186
+ 'value': 9,
187
187
  'expect': true
188
188
  },
189
189
  {
190
- 'inputName': 'number 1.23',
191
- 'inputValue': 1.23,
190
+ 'title': 'number 1.23',
191
+ 'value': 1.23,
192
192
  'expect': false
193
193
  },
194
194
  {
195
- 'inputName': 'string \'11\'',
196
- 'inputValue': '11',
195
+ 'title': 'string \'11\'',
196
+ 'value': '11',
197
197
  'expect': false
198
198
  },
199
199
  {
200
- 'inputName': 'string \'10\'',
201
- 'inputValue': '10',
200
+ 'title': 'string \'10\'',
201
+ 'value': '10',
202
202
  'expect': true
203
203
  },
204
204
  {
205
- 'inputName': 'string \'-1\'',
206
- 'inputValue': '-1',
205
+ 'title': 'string \'-1\'',
206
+ 'value': '-1',
207
207
  'expect': true
208
208
  },
209
209
  {
210
- 'inputName': 'string \'9\'',
211
- 'inputValue': '9',
210
+ 'title': 'string \'9\'',
211
+ 'value': '9',
212
212
  'expect': true
213
213
  },
214
214
  {
215
- 'inputName': 'string \'1.23\'',
216
- 'inputValue': '1.23',
215
+ 'title': 'string \'1.23\'',
216
+ 'value': '1.23',
217
217
  'expect': false
218
218
  },
219
- ...defaultItemss({
219
+ ...defaultItems({
220
220
  'number 0': true,
221
221
  'number 1': true
222
222
  })
@@ -227,76 +227,76 @@ const testItems: ITestSuite = {
227
227
  'rule': ['$.string', 'int(-12, 25)'],
228
228
  'items': [
229
229
  {
230
- 'inputName': 'number -1',
231
- 'inputValue': -1,
230
+ 'title': 'number -1',
231
+ 'value': -1,
232
232
  'expect': true
233
233
  },
234
234
  {
235
- 'inputName': 'number -12',
236
- 'inputValue': -12,
235
+ 'title': 'number -12',
236
+ 'value': -12,
237
237
  'expect': true
238
238
  },
239
239
  {
240
- 'inputName': 'number 25',
241
- 'inputValue': 25,
240
+ 'title': 'number 25',
241
+ 'value': 25,
242
242
  'expect': true
243
243
  },
244
244
  {
245
- 'inputName': 'number 26',
246
- 'inputValue': 26,
245
+ 'title': 'number 26',
246
+ 'value': 26,
247
247
  'expect': false
248
248
  },
249
249
  {
250
- 'inputName': 'number -13',
251
- 'inputValue': -13,
250
+ 'title': 'number -13',
251
+ 'value': -13,
252
252
  'expect': false
253
253
  },
254
254
  {
255
- 'inputName': 'number -11.5',
256
- 'inputValue': -11.5,
255
+ 'title': 'number -11.5',
256
+ 'value': -11.5,
257
257
  'expect': false
258
258
  },
259
259
  {
260
- 'inputName': 'number 1.23',
261
- 'inputValue': 1.23,
260
+ 'title': 'number 1.23',
261
+ 'value': 1.23,
262
262
  'expect': false
263
263
  },
264
264
  {
265
- 'inputName': 'string \'-1\'',
266
- 'inputValue': '-1',
265
+ 'title': 'string \'-1\'',
266
+ 'value': '-1',
267
267
  'expect': true
268
268
  },
269
269
  {
270
- 'inputName': 'string \'-12\'',
271
- 'inputValue': '-12',
270
+ 'title': 'string \'-12\'',
271
+ 'value': '-12',
272
272
  'expect': true
273
273
  },
274
274
  {
275
- 'inputName': 'string \'25\'',
276
- 'inputValue': '25',
275
+ 'title': 'string \'25\'',
276
+ 'value': '25',
277
277
  'expect': true
278
278
  },
279
279
  {
280
- 'inputName': 'string \'26\'',
281
- 'inputValue': '26',
280
+ 'title': 'string \'26\'',
281
+ 'value': '26',
282
282
  'expect': false
283
283
  },
284
284
  {
285
- 'inputName': 'string \'-13\'',
286
- 'inputValue': '-13',
285
+ 'title': 'string \'-13\'',
286
+ 'value': '-13',
287
287
  'expect': false
288
288
  },
289
289
  {
290
- 'inputName': 'string \'-11.5\'',
291
- 'inputValue': '-11.5',
290
+ 'title': 'string \'-11.5\'',
291
+ 'value': '-11.5',
292
292
  'expect': false
293
293
  },
294
294
  {
295
- 'inputName': 'string \'1.23\'',
296
- 'inputValue': '1.23',
295
+ 'title': 'string \'1.23\'',
296
+ 'value': '1.23',
297
297
  'expect': false
298
298
  },
299
- ...defaultItemss({
299
+ ...defaultItems({
300
300
  'number 0': true,
301
301
  'number 1': true
302
302
  })
@@ -307,76 +307,76 @@ const testItems: ITestSuite = {
307
307
  'rule': ['$.string', 'int8'],
308
308
  'items': [
309
309
  {
310
- 'inputName': 'number -1',
311
- 'inputValue': -1,
310
+ 'title': 'number -1',
311
+ 'value': -1,
312
312
  'expect': true
313
313
  },
314
314
  {
315
- 'inputName': 'number -0x80',
316
- 'inputValue': -0x80,
315
+ 'title': 'number -0x80',
316
+ 'value': -0x80,
317
317
  'expect': true
318
318
  },
319
319
  {
320
- 'inputName': 'number 0x7F',
321
- 'inputValue': 0x7F,
320
+ 'title': 'number 0x7F',
321
+ 'value': 0x7F,
322
322
  'expect': true
323
323
  },
324
324
  {
325
- 'inputName': 'number 0x80',
326
- 'inputValue': 0x80,
325
+ 'title': 'number 0x80',
326
+ 'value': 0x80,
327
327
  'expect': false
328
328
  },
329
329
  {
330
- 'inputName': 'number -0x81',
331
- 'inputValue': -0x81,
330
+ 'title': 'number -0x81',
331
+ 'value': -0x81,
332
332
  'expect': false
333
333
  },
334
334
  {
335
- 'inputName': 'number 1.23',
336
- 'inputValue': 1.23,
335
+ 'title': 'number 1.23',
336
+ 'value': 1.23,
337
337
  'expect': false
338
338
  },
339
339
  {
340
- 'inputName': 'number -1.23',
341
- 'inputValue': -1.23,
340
+ 'title': 'number -1.23',
341
+ 'value': -1.23,
342
342
  'expect': false
343
343
  },
344
344
  {
345
- 'inputName': 'string \'-1\'',
346
- 'inputValue': (-1).toString(),
345
+ 'title': 'string \'-1\'',
346
+ 'value': (-1).toString(),
347
347
  'expect': true
348
348
  },
349
349
  {
350
- 'inputName': 'string \'-0x80\'',
351
- 'inputValue': (-0x80).toString(),
350
+ 'title': 'string \'-0x80\'',
351
+ 'value': (-0x80).toString(),
352
352
  'expect': true
353
353
  },
354
354
  {
355
- 'inputName': 'string \'0x7F\'',
356
- 'inputValue': (0x7F).toString(),
355
+ 'title': 'string \'0x7F\'',
356
+ 'value': (0x7F).toString(),
357
357
  'expect': true
358
358
  },
359
359
  {
360
- 'inputName': 'string \'0x80\'',
361
- 'inputValue': (0x80).toString(),
360
+ 'title': 'string \'0x80\'',
361
+ 'value': (0x80).toString(),
362
362
  'expect': false
363
363
  },
364
364
  {
365
- 'inputName': 'string \'-0x81\'',
366
- 'inputValue': (-0x81).toString(),
365
+ 'title': 'string \'-0x81\'',
366
+ 'value': (-0x81).toString(),
367
367
  'expect': false
368
368
  },
369
369
  {
370
- 'inputName': 'string \'1.23\'',
371
- 'inputValue': (1.23).toString(),
370
+ 'title': 'string \'1.23\'',
371
+ 'value': (1.23).toString(),
372
372
  'expect': false
373
373
  },
374
374
  {
375
- 'inputName': 'string \'-1.23\'',
376
- 'inputValue': (-1.23).toString(),
375
+ 'title': 'string \'-1.23\'',
376
+ 'value': (-1.23).toString(),
377
377
  'expect': false
378
378
  },
379
- ...defaultItemss({
379
+ ...defaultItems({
380
380
  'number 0': true,
381
381
  'number 1': true
382
382
  })
@@ -387,76 +387,76 @@ const testItems: ITestSuite = {
387
387
  'rule': ['$.string', 'int16'],
388
388
  'items': [
389
389
  {
390
- 'inputName': 'number -1',
391
- 'inputValue': -1,
390
+ 'title': 'number -1',
391
+ 'value': -1,
392
392
  'expect': true
393
393
  },
394
394
  {
395
- 'inputName': 'number -0x8000',
396
- 'inputValue': -0x8000,
395
+ 'title': 'number -0x8000',
396
+ 'value': -0x8000,
397
397
  'expect': true
398
398
  },
399
399
  {
400
- 'inputName': 'number 0x7FFF',
401
- 'inputValue': 0x7FFF,
400
+ 'title': 'number 0x7FFF',
401
+ 'value': 0x7FFF,
402
402
  'expect': true
403
403
  },
404
404
  {
405
- 'inputName': 'number 0x8000',
406
- 'inputValue': 0x8000,
405
+ 'title': 'number 0x8000',
406
+ 'value': 0x8000,
407
407
  'expect': false
408
408
  },
409
409
  {
410
- 'inputName': 'number -0x8001',
411
- 'inputValue': -0x8001,
410
+ 'title': 'number -0x8001',
411
+ 'value': -0x8001,
412
412
  'expect': false
413
413
  },
414
414
  {
415
- 'inputName': 'number 1.23',
416
- 'inputValue': 1.23,
415
+ 'title': 'number 1.23',
416
+ 'value': 1.23,
417
417
  'expect': false
418
418
  },
419
419
  {
420
- 'inputName': 'number -1.23',
421
- 'inputValue': -1.23,
420
+ 'title': 'number -1.23',
421
+ 'value': -1.23,
422
422
  'expect': false
423
423
  },
424
424
  {
425
- 'inputName': 'string \'-1\'',
426
- 'inputValue': (-1).toString(),
425
+ 'title': 'string \'-1\'',
426
+ 'value': (-1).toString(),
427
427
  'expect': true
428
428
  },
429
429
  {
430
- 'inputName': 'string \'-0x8000\'',
431
- 'inputValue': (-0x8000).toString(),
430
+ 'title': 'string \'-0x8000\'',
431
+ 'value': (-0x8000).toString(),
432
432
  'expect': true
433
433
  },
434
434
  {
435
- 'inputName': 'string \'0x7FFF\'',
436
- 'inputValue': (0x7FFF).toString(),
435
+ 'title': 'string \'0x7FFF\'',
436
+ 'value': (0x7FFF).toString(),
437
437
  'expect': true
438
438
  },
439
439
  {
440
- 'inputName': 'string \'0x8000\'',
441
- 'inputValue': (0x8000).toString(),
440
+ 'title': 'string \'0x8000\'',
441
+ 'value': (0x8000).toString(),
442
442
  'expect': false
443
443
  },
444
444
  {
445
- 'inputName': 'string \'-0x8001\'',
446
- 'inputValue': (-0x8001).toString(),
445
+ 'title': 'string \'-0x8001\'',
446
+ 'value': (-0x8001).toString(),
447
447
  'expect': false
448
448
  },
449
449
  {
450
- 'inputName': 'string \'1.23\'',
451
- 'inputValue': (1.23).toString(),
450
+ 'title': 'string \'1.23\'',
451
+ 'value': (1.23).toString(),
452
452
  'expect': false
453
453
  },
454
454
  {
455
- 'inputName': 'string \'-1.23\'',
456
- 'inputValue': (-1.23).toString(),
455
+ 'title': 'string \'-1.23\'',
456
+ 'value': (-1.23).toString(),
457
457
  'expect': false
458
458
  },
459
- ...defaultItemss({
459
+ ...defaultItems({
460
460
  'number 0': true,
461
461
  'number 1': true
462
462
  })
@@ -467,76 +467,76 @@ const testItems: ITestSuite = {
467
467
  'rule': ['$.string', 'int32'],
468
468
  'items': [
469
469
  {
470
- 'inputName': 'number -1',
471
- 'inputValue': -1,
470
+ 'title': 'number -1',
471
+ 'value': -1,
472
472
  'expect': true
473
473
  },
474
474
  {
475
- 'inputName': 'number -0x80000000',
476
- 'inputValue': -0x80000000,
475
+ 'title': 'number -0x80000000',
476
+ 'value': -0x80000000,
477
477
  'expect': true
478
478
  },
479
479
  {
480
- 'inputName': 'number 0x7FFFFFFF',
481
- 'inputValue': 0x7FFFFFFF,
480
+ 'title': 'number 0x7FFFFFFF',
481
+ 'value': 0x7FFFFFFF,
482
482
  'expect': true
483
483
  },
484
484
  {
485
- 'inputName': 'number 0x80000000',
486
- 'inputValue': 0x80000000,
485
+ 'title': 'number 0x80000000',
486
+ 'value': 0x80000000,
487
487
  'expect': false
488
488
  },
489
489
  {
490
- 'inputName': 'number -0x80000001',
491
- 'inputValue': -0x80000001,
490
+ 'title': 'number -0x80000001',
491
+ 'value': -0x80000001,
492
492
  'expect': false
493
493
  },
494
494
  {
495
- 'inputName': 'number 1.23',
496
- 'inputValue': 1.23,
495
+ 'title': 'number 1.23',
496
+ 'value': 1.23,
497
497
  'expect': false
498
498
  },
499
499
  {
500
- 'inputName': 'number -1.23',
501
- 'inputValue': -1.23,
500
+ 'title': 'number -1.23',
501
+ 'value': -1.23,
502
502
  'expect': false
503
503
  },
504
504
  {
505
- 'inputName': 'string \'-1\'',
506
- 'inputValue': (-1).toString(),
505
+ 'title': 'string \'-1\'',
506
+ 'value': (-1).toString(),
507
507
  'expect': true
508
508
  },
509
509
  {
510
- 'inputName': 'string \'-0x80000000\'',
511
- 'inputValue': (-0x80000000).toString(),
510
+ 'title': 'string \'-0x80000000\'',
511
+ 'value': (-0x80000000).toString(),
512
512
  'expect': true
513
513
  },
514
514
  {
515
- 'inputName': 'string \'0x7FFFFFFF\'',
516
- 'inputValue': (0x7FFFFFFF).toString(),
515
+ 'title': 'string \'0x7FFFFFFF\'',
516
+ 'value': (0x7FFFFFFF).toString(),
517
517
  'expect': true
518
518
  },
519
519
  {
520
- 'inputName': 'string \'0x80000000\'',
521
- 'inputValue': (0x80000000).toString(),
520
+ 'title': 'string \'0x80000000\'',
521
+ 'value': (0x80000000).toString(),
522
522
  'expect': false
523
523
  },
524
524
  {
525
- 'inputName': 'string \'-0x80000001\'',
526
- 'inputValue': (-0x80000001).toString(),
525
+ 'title': 'string \'-0x80000001\'',
526
+ 'value': (-0x80000001).toString(),
527
527
  'expect': false
528
528
  },
529
529
  {
530
- 'inputName': 'string \'1.23\'',
531
- 'inputValue': (1.23).toString(),
530
+ 'title': 'string \'1.23\'',
531
+ 'value': (1.23).toString(),
532
532
  'expect': false
533
533
  },
534
534
  {
535
- 'inputName': 'string \'-1.23\'',
536
- 'inputValue': (-1.23).toString(),
535
+ 'title': 'string \'-1.23\'',
536
+ 'value': (-1.23).toString(),
537
537
  'expect': false
538
538
  },
539
- ...defaultItemss({
539
+ ...defaultItems({
540
540
  'number 0': true,
541
541
  'number 1': true
542
542
  })
@@ -547,66 +547,66 @@ const testItems: ITestSuite = {
547
547
  'rule': ['$.string', 'int64'],
548
548
  'items': [
549
549
  {
550
- 'inputName': 'number -1',
551
- 'inputValue': -1,
550
+ 'title': 'number -1',
551
+ 'value': -1,
552
552
  'expect': true
553
553
  },
554
554
  {
555
- 'inputName': 'number -0x8000000000000000',
556
- 'inputValue': -0x8000000000000000,
555
+ 'title': 'number -0x8000000000000000',
556
+ 'value': -0x8000000000000000,
557
557
  'expect': true
558
558
  },
559
559
  {
560
- 'inputName': 'number 0x7FFFFFFF',
561
- 'inputValue': 0x7FFFFFFF,
560
+ 'title': 'number 0x7FFFFFFF',
561
+ 'value': 0x7FFFFFFF,
562
562
  'expect': true
563
563
  },
564
564
  {
565
- 'inputName': 'number 0x7FFFFFFFFFFFFFFF',
566
- 'inputValue': 0x7FFFFFFFFFFFFFFF,
565
+ 'title': 'number 0x7FFFFFFFFFFFFFFF',
566
+ 'value': 0x7FFFFFFFFFFFFFFF,
567
567
  'expect': true
568
568
  },
569
569
  {
570
- 'inputName': 'number 1.23',
571
- 'inputValue': 1.23,
570
+ 'title': 'number 1.23',
571
+ 'value': 1.23,
572
572
  'expect': false
573
573
  },
574
574
  {
575
- 'inputName': 'number -1.23',
576
- 'inputValue': -1.23,
575
+ 'title': 'number -1.23',
576
+ 'value': -1.23,
577
577
  'expect': false
578
578
  },
579
579
  {
580
- 'inputName': 'string \'-1\'',
581
- 'inputValue': (-1).toString(),
580
+ 'title': 'string \'-1\'',
581
+ 'value': (-1).toString(),
582
582
  'expect': true
583
583
  },
584
584
  {
585
- 'inputName': 'string \'-0x8000000000000000\'',
586
- 'inputValue': (-0x8000000000000000).toString(),
585
+ 'title': 'string \'-0x8000000000000000\'',
586
+ 'value': (-0x8000000000000000).toString(),
587
587
  'expect': true
588
588
  },
589
589
  {
590
- 'inputName': 'string \'0x7FFFFFFF\'',
591
- 'inputValue': (0x7FFFFFFF).toString(),
590
+ 'title': 'string \'0x7FFFFFFF\'',
591
+ 'value': (0x7FFFFFFF).toString(),
592
592
  'expect': true
593
593
  },
594
594
  {
595
- 'inputName': 'string \'0x7FFFFFFFFFFFFFFF\'',
596
- 'inputValue': (0x7FFFFFFFFFFFFFFF).toString(),
595
+ 'title': 'string \'0x7FFFFFFFFFFFFFFF\'',
596
+ 'value': (0x7FFFFFFFFFFFFFFF).toString(),
597
597
  'expect': true
598
598
  },
599
599
  {
600
- 'inputName': 'string \'1.23\'',
601
- 'inputValue': (1.23).toString(),
600
+ 'title': 'string \'1.23\'',
601
+ 'value': (1.23).toString(),
602
602
  'expect': false
603
603
  },
604
604
  {
605
- 'inputName': 'string \'-1.23\'',
606
- 'inputValue': (-1.23).toString(),
605
+ 'title': 'string \'-1.23\'',
606
+ 'value': (-1.23).toString(),
607
607
  'expect': false
608
608
  },
609
- ...defaultItemss({
609
+ ...defaultItems({
610
610
  'number 0': true,
611
611
  'number 1': true
612
612
  })
@@ -617,36 +617,36 @@ const testItems: ITestSuite = {
617
617
  'rule': ['$.string', 'uint'],
618
618
  'items': [
619
619
  {
620
- 'inputName': 'number -1',
621
- 'inputValue': -1,
620
+ 'title': 'number -1',
621
+ 'value': -1,
622
622
  'expect': false
623
623
  },
624
624
  {
625
- 'inputName': 'number 1.23',
626
- 'inputValue': 1.23,
625
+ 'title': 'number 1.23',
626
+ 'value': 1.23,
627
627
  'expect': false
628
628
  },
629
629
  {
630
- 'inputName': 'string \'-1\'',
631
- 'inputValue': (-1).toString(),
630
+ 'title': 'string \'-1\'',
631
+ 'value': (-1).toString(),
632
632
  'expect': false
633
633
  },
634
634
  {
635
- 'inputName': 'string \'1.23\'',
636
- 'inputValue': (1.23).toString(),
635
+ 'title': 'string \'1.23\'',
636
+ 'value': (1.23).toString(),
637
637
  'expect': false
638
638
  },
639
639
  {
640
- 'inputName': 'string \'1\'',
641
- 'inputValue': (1).toString(),
640
+ 'title': 'string \'1\'',
641
+ 'value': (1).toString(),
642
642
  'expect': true
643
643
  },
644
644
  {
645
- 'inputName': 'string \'0\'',
646
- 'inputValue': (0).toString(),
645
+ 'title': 'string \'0\'',
646
+ 'value': (0).toString(),
647
647
  'expect': true
648
648
  },
649
- ...defaultItemss({
649
+ ...defaultItems({
650
650
  'number 0': true,
651
651
  'number 1': true
652
652
  })
@@ -657,56 +657,56 @@ const testItems: ITestSuite = {
657
657
  'rule': ['$.string', 'uint8'],
658
658
  'items': [
659
659
  {
660
- 'inputName': 'number -1',
661
- 'inputValue': -1,
660
+ 'title': 'number -1',
661
+ 'value': -1,
662
662
  'expect': false
663
663
  },
664
664
  {
665
- 'inputName': 'number 0xFF',
666
- 'inputValue': 0xFF,
665
+ 'title': 'number 0xFF',
666
+ 'value': 0xFF,
667
667
  'expect': true
668
668
  },
669
669
  {
670
- 'inputName': 'number 0x100',
671
- 'inputValue': 0x100,
670
+ 'title': 'number 0x100',
671
+ 'value': 0x100,
672
672
  'expect': false
673
673
  },
674
674
  {
675
- 'inputName': 'number 1.23',
676
- 'inputValue': 1.23,
675
+ 'title': 'number 1.23',
676
+ 'value': 1.23,
677
677
  'expect': false
678
678
  },
679
679
  {
680
- 'inputName': 'number -1.23',
681
- 'inputValue': -1.23,
680
+ 'title': 'number -1.23',
681
+ 'value': -1.23,
682
682
  'expect': false
683
683
  },
684
684
  {
685
- 'inputName': 'string \'-1\'',
686
- 'inputValue': (-1).toString(),
685
+ 'title': 'string \'-1\'',
686
+ 'value': (-1).toString(),
687
687
  'expect': false
688
688
  },
689
689
  {
690
- 'inputName': 'string \'0xFF\'',
691
- 'inputValue': (0xFF).toString(),
690
+ 'title': 'string \'0xFF\'',
691
+ 'value': (0xFF).toString(),
692
692
  'expect': true
693
693
  },
694
694
  {
695
- 'inputName': 'string \'0x100\'',
696
- 'inputValue': (0x100).toString(),
695
+ 'title': 'string \'0x100\'',
696
+ 'value': (0x100).toString(),
697
697
  'expect': false
698
698
  },
699
699
  {
700
- 'inputName': 'string \'1.23\'',
701
- 'inputValue': (1.23).toString(),
700
+ 'title': 'string \'1.23\'',
701
+ 'value': (1.23).toString(),
702
702
  'expect': false
703
703
  },
704
704
  {
705
- 'inputName': 'string \'-1.23\'',
706
- 'inputValue': (-1.23).toString(),
705
+ 'title': 'string \'-1.23\'',
706
+ 'value': (-1.23).toString(),
707
707
  'expect': false
708
708
  },
709
- ...defaultItemss({
709
+ ...defaultItems({
710
710
  'number 0': true,
711
711
  'number 1': true
712
712
  })
@@ -717,56 +717,56 @@ const testItems: ITestSuite = {
717
717
  'rule': ['$.string', 'uint16'],
718
718
  'items': [
719
719
  {
720
- 'inputName': 'number -1',
721
- 'inputValue': -1,
720
+ 'title': 'number -1',
721
+ 'value': -1,
722
722
  'expect': false
723
723
  },
724
724
  {
725
- 'inputName': 'number 0xFFFF',
726
- 'inputValue': 0xFFFF,
725
+ 'title': 'number 0xFFFF',
726
+ 'value': 0xFFFF,
727
727
  'expect': true
728
728
  },
729
729
  {
730
- 'inputName': 'number 0x10000',
731
- 'inputValue': 0x10000,
730
+ 'title': 'number 0x10000',
731
+ 'value': 0x10000,
732
732
  'expect': false
733
733
  },
734
734
  {
735
- 'inputName': 'number 1.23',
736
- 'inputValue': 1.23,
735
+ 'title': 'number 1.23',
736
+ 'value': 1.23,
737
737
  'expect': false
738
738
  },
739
739
  {
740
- 'inputName': 'number -1.23',
741
- 'inputValue': -1.23,
740
+ 'title': 'number -1.23',
741
+ 'value': -1.23,
742
742
  'expect': false
743
743
  },
744
744
  {
745
- 'inputName': 'string \'-1\'',
746
- 'inputValue': (-1).toString(),
745
+ 'title': 'string \'-1\'',
746
+ 'value': (-1).toString(),
747
747
  'expect': false
748
748
  },
749
749
  {
750
- 'inputName': 'string \'0xFFFF\'',
751
- 'inputValue': (0xFFFF).toString(),
750
+ 'title': 'string \'0xFFFF\'',
751
+ 'value': (0xFFFF).toString(),
752
752
  'expect': true
753
753
  },
754
754
  {
755
- 'inputName': 'string \'0x10000\'',
756
- 'inputValue': (0x10000).toString(),
755
+ 'title': 'string \'0x10000\'',
756
+ 'value': (0x10000).toString(),
757
757
  'expect': false
758
758
  },
759
759
  {
760
- 'inputName': 'string \'1.23\'',
761
- 'inputValue': (1.23).toString(),
760
+ 'title': 'string \'1.23\'',
761
+ 'value': (1.23).toString(),
762
762
  'expect': false
763
763
  },
764
764
  {
765
- 'inputName': 'string \'-1.23\'',
766
- 'inputValue': (-1.23).toString(),
765
+ 'title': 'string \'-1.23\'',
766
+ 'value': (-1.23).toString(),
767
767
  'expect': false
768
768
  },
769
- ...defaultItemss({
769
+ ...defaultItems({
770
770
  'number 0': true,
771
771
  'number 1': true
772
772
  })
@@ -777,56 +777,56 @@ const testItems: ITestSuite = {
777
777
  'rule': ['$.string', 'uint32'],
778
778
  'items': [
779
779
  {
780
- 'inputName': 'number -1',
781
- 'inputValue': -1,
780
+ 'title': 'number -1',
781
+ 'value': -1,
782
782
  'expect': false
783
783
  },
784
784
  {
785
- 'inputName': 'number 0xFFFFFFFF',
786
- 'inputValue': 0xFFFFFFFF,
785
+ 'title': 'number 0xFFFFFFFF',
786
+ 'value': 0xFFFFFFFF,
787
787
  'expect': true
788
788
  },
789
789
  {
790
- 'inputName': 'number 0x100000000',
791
- 'inputValue': 0x100000000,
790
+ 'title': 'number 0x100000000',
791
+ 'value': 0x100000000,
792
792
  'expect': false
793
793
  },
794
794
  {
795
- 'inputName': 'number 1.23',
796
- 'inputValue': 1.23,
795
+ 'title': 'number 1.23',
796
+ 'value': 1.23,
797
797
  'expect': false
798
798
  },
799
799
  {
800
- 'inputName': 'number -1.23',
801
- 'inputValue': -1.23,
800
+ 'title': 'number -1.23',
801
+ 'value': -1.23,
802
802
  'expect': false
803
803
  },
804
804
  {
805
- 'inputName': 'string \'-1\'',
806
- 'inputValue': (-1).toString(),
805
+ 'title': 'string \'-1\'',
806
+ 'value': (-1).toString(),
807
807
  'expect': false
808
808
  },
809
809
  {
810
- 'inputName': 'string \'0xFFFFFFFF\'',
811
- 'inputValue': (0xFFFFFFFF).toString(),
810
+ 'title': 'string \'0xFFFFFFFF\'',
811
+ 'value': (0xFFFFFFFF).toString(),
812
812
  'expect': true
813
813
  },
814
814
  {
815
- 'inputName': 'string \'0x100000000\'',
816
- 'inputValue': (0x100000000).toString(),
815
+ 'title': 'string \'0x100000000\'',
816
+ 'value': (0x100000000).toString(),
817
817
  'expect': false
818
818
  },
819
819
  {
820
- 'inputName': 'string \'1.23\'',
821
- 'inputValue': (1.23).toString(),
820
+ 'title': 'string \'1.23\'',
821
+ 'value': (1.23).toString(),
822
822
  'expect': false
823
823
  },
824
824
  {
825
- 'inputName': 'string \'-1.23\'',
826
- 'inputValue': (-1.23).toString(),
825
+ 'title': 'string \'-1.23\'',
826
+ 'value': (-1.23).toString(),
827
827
  'expect': false
828
828
  },
829
- ...defaultItemss({
829
+ ...defaultItems({
830
830
  'number 0': true,
831
831
  'number 1': true
832
832
  })
@@ -837,56 +837,56 @@ const testItems: ITestSuite = {
837
837
  'rule': ['$.string', 'uint64'],
838
838
  'items': [
839
839
  {
840
- 'inputName': 'number -1',
841
- 'inputValue': -1,
840
+ 'title': 'number -1',
841
+ 'value': -1,
842
842
  'expect': false
843
843
  },
844
844
  {
845
- 'inputName': 'number 0xFFFFFFFFFFFFFFFF',
846
- 'inputValue': 0xFFFFFFFFFFFFFFFF,
845
+ 'title': 'number 0xFFFFFFFFFFFFFFFF',
846
+ 'value': 0xFFFFFFFFFFFFFFFF,
847
847
  'expect': true
848
848
  },
849
849
  {
850
- 'inputName': 'number 0x7FFFFFFF',
851
- 'inputValue': 0x7FFFFFFF,
850
+ 'title': 'number 0x7FFFFFFF',
851
+ 'value': 0x7FFFFFFF,
852
852
  'expect': true
853
853
  },
854
854
  {
855
- 'inputName': 'number 1.23',
856
- 'inputValue': 1.23,
855
+ 'title': 'number 1.23',
856
+ 'value': 1.23,
857
857
  'expect': false
858
858
  },
859
859
  {
860
- 'inputName': 'number -1.23',
861
- 'inputValue': -1.23,
860
+ 'title': 'number -1.23',
861
+ 'value': -1.23,
862
862
  'expect': false
863
863
  },
864
864
  {
865
- 'inputName': 'string \'-1\'',
866
- 'inputValue': (-1).toString(),
865
+ 'title': 'string \'-1\'',
866
+ 'value': (-1).toString(),
867
867
  'expect': false
868
868
  },
869
869
  {
870
- 'inputName': 'string \'0xFFFFFFFFFFFFFFFF\'',
871
- 'inputValue': (0xFFFFFFFFFFFFFFFF).toString(),
870
+ 'title': 'string \'0xFFFFFFFFFFFFFFFF\'',
871
+ 'value': (0xFFFFFFFFFFFFFFFF).toString(),
872
872
  'expect': true
873
873
  },
874
874
  {
875
- 'inputName': 'string \'0x7FFFFFFF\'',
876
- 'inputValue': (0x7FFFFFFF).toString(),
875
+ 'title': 'string \'0x7FFFFFFF\'',
876
+ 'value': (0x7FFFFFFF).toString(),
877
877
  'expect': true
878
878
  },
879
879
  {
880
- 'inputName': 'string \'1.23\'',
881
- 'inputValue': (1.23).toString(),
880
+ 'title': 'string \'1.23\'',
881
+ 'value': (1.23).toString(),
882
882
  'expect': false
883
883
  },
884
884
  {
885
- 'inputName': 'string \'-1.23\'',
886
- 'inputValue': (-1.23).toString(),
885
+ 'title': 'string \'-1.23\'',
886
+ 'value': (-1.23).toString(),
887
887
  'expect': false
888
888
  },
889
- ...defaultItemss({
889
+ ...defaultItems({
890
890
  'number 0': true,
891
891
  'number 1': true
892
892
  })
@@ -897,76 +897,76 @@ const testItems: ITestSuite = {
897
897
  'rule': ['$.string', 'safe_int'],
898
898
  'items': [
899
899
  {
900
- 'inputName': 'number -1',
901
- 'inputValue': -1,
900
+ 'title': 'number -1',
901
+ 'value': -1,
902
902
  'expect': true
903
903
  },
904
904
  {
905
- 'inputName': 'number 9007199254740991',
906
- 'inputValue': 9007199254740991,
905
+ 'title': 'number 9007199254740991',
906
+ 'value': 9007199254740991,
907
907
  'expect': true
908
908
  },
909
909
  {
910
- 'inputName': 'number -9007199254740991',
911
- 'inputValue': -9007199254740991,
910
+ 'title': 'number -9007199254740991',
911
+ 'value': -9007199254740991,
912
912
  'expect': true
913
913
  },
914
914
  {
915
- 'inputName': 'number 9007199254740992',
916
- 'inputValue': 9007199254740992,
915
+ 'title': 'number 9007199254740992',
916
+ 'value': 9007199254740992,
917
917
  'expect': false
918
918
  },
919
919
  {
920
- 'inputName': 'number -9007199254740992',
921
- 'inputValue': -9007199254740992,
920
+ 'title': 'number -9007199254740992',
921
+ 'value': -9007199254740992,
922
922
  'expect': false
923
923
  },
924
924
  {
925
- 'inputName': 'number 1.23',
926
- 'inputValue': 1.23,
925
+ 'title': 'number 1.23',
926
+ 'value': 1.23,
927
927
  'expect': false
928
928
  },
929
929
  {
930
- 'inputName': 'number -1.23',
931
- 'inputValue': -1.23,
930
+ 'title': 'number -1.23',
931
+ 'value': -1.23,
932
932
  'expect': false
933
933
  },
934
934
  {
935
- 'inputName': 'string \'-1\'',
936
- 'inputValue': (-1).toString(),
935
+ 'title': 'string \'-1\'',
936
+ 'value': (-1).toString(),
937
937
  'expect': true
938
938
  },
939
939
  {
940
- 'inputName': 'string \'9007199254740991\'',
941
- 'inputValue': (9007199254740991).toString(),
940
+ 'title': 'string \'9007199254740991\'',
941
+ 'value': (9007199254740991).toString(),
942
942
  'expect': true
943
943
  },
944
944
  {
945
- 'inputName': 'string \'-9007199254740991\'',
946
- 'inputValue': (-9007199254740991).toString(),
945
+ 'title': 'string \'-9007199254740991\'',
946
+ 'value': (-9007199254740991).toString(),
947
947
  'expect': true
948
948
  },
949
949
  {
950
- 'inputName': 'string \'9007199254740992\'',
951
- 'inputValue': (9007199254740992).toString(),
950
+ 'title': 'string \'9007199254740992\'',
951
+ 'value': (9007199254740992).toString(),
952
952
  'expect': false
953
953
  },
954
954
  {
955
- 'inputName': 'string \'-9007199254740992\'',
956
- 'inputValue': (-9007199254740992).toString(),
955
+ 'title': 'string \'-9007199254740992\'',
956
+ 'value': (-9007199254740992).toString(),
957
957
  'expect': false
958
958
  },
959
959
  {
960
- 'inputName': 'string \'1.23\'',
961
- 'inputValue': (1.23).toString(),
960
+ 'title': 'string \'1.23\'',
961
+ 'value': (1.23).toString(),
962
962
  'expect': false
963
963
  },
964
964
  {
965
- 'inputName': 'string \'-1.23\'',
966
- 'inputValue': (-1.23).toString(),
965
+ 'title': 'string \'-1.23\'',
966
+ 'value': (-1.23).toString(),
967
967
  'expect': false
968
968
  },
969
- ...defaultItemss({
969
+ ...defaultItems({
970
970
  'number 0': true,
971
971
  'number 1': true
972
972
  })
@@ -977,56 +977,56 @@ const testItems: ITestSuite = {
977
977
  'rule': ['$.string', 'safe_uint'],
978
978
  'items': [
979
979
  {
980
- 'inputName': 'number -1',
981
- 'inputValue': -1,
980
+ 'title': 'number -1',
981
+ 'value': -1,
982
982
  'expect': false
983
983
  },
984
984
  {
985
- 'inputName': 'number 9007199254740991',
986
- 'inputValue': 9007199254740991,
985
+ 'title': 'number 9007199254740991',
986
+ 'value': 9007199254740991,
987
987
  'expect': true
988
988
  },
989
989
  {
990
- 'inputName': 'number 9007199254740992',
991
- 'inputValue': 9007199254740992,
990
+ 'title': 'number 9007199254740992',
991
+ 'value': 9007199254740992,
992
992
  'expect': false
993
993
  },
994
994
  {
995
- 'inputName': 'number 1.23',
996
- 'inputValue': 1.23,
995
+ 'title': 'number 1.23',
996
+ 'value': 1.23,
997
997
  'expect': false
998
998
  },
999
999
  {
1000
- 'inputName': 'number -1.23',
1001
- 'inputValue': -1.23,
1000
+ 'title': 'number -1.23',
1001
+ 'value': -1.23,
1002
1002
  'expect': false
1003
1003
  },
1004
1004
  {
1005
- 'inputName': 'string \'-1\'',
1006
- 'inputValue': (-1).toString(),
1005
+ 'title': 'string \'-1\'',
1006
+ 'value': (-1).toString(),
1007
1007
  'expect': false
1008
1008
  },
1009
1009
  {
1010
- 'inputName': 'string \'9007199254740991\'',
1011
- 'inputValue': (9007199254740991).toString(),
1010
+ 'title': 'string \'9007199254740991\'',
1011
+ 'value': (9007199254740991).toString(),
1012
1012
  'expect': true
1013
1013
  },
1014
1014
  {
1015
- 'inputName': 'string \'9007199254740992\'',
1016
- 'inputValue': (9007199254740992).toString(),
1015
+ 'title': 'string \'9007199254740992\'',
1016
+ 'value': (9007199254740992).toString(),
1017
1017
  'expect': false
1018
1018
  },
1019
1019
  {
1020
- 'inputName': 'string \'1.23\'',
1021
- 'inputValue': (1.23).toString(),
1020
+ 'title': 'string \'1.23\'',
1021
+ 'value': (1.23).toString(),
1022
1022
  'expect': false
1023
1023
  },
1024
1024
  {
1025
- 'inputName': 'string \'-1.23\'',
1026
- 'inputValue': (-1.23).toString(),
1025
+ 'title': 'string \'-1.23\'',
1026
+ 'value': (-1.23).toString(),
1027
1027
  'expect': false
1028
1028
  },
1029
- ...defaultItemss({
1029
+ ...defaultItems({
1030
1030
  'number 0': true,
1031
1031
  'number 1': true
1032
1032
  })
@@ -1037,46 +1037,46 @@ const testItems: ITestSuite = {
1037
1037
  'rule': ['$.string', 'float'],
1038
1038
  'items': [
1039
1039
  {
1040
- 'inputName': 'number -1',
1041
- 'inputValue': -1,
1040
+ 'title': 'number -1',
1041
+ 'value': -1,
1042
1042
  'expect': true
1043
1043
  },
1044
1044
  {
1045
- 'inputName': 'number 120312',
1046
- 'inputValue': 120312,
1045
+ 'title': 'number 120312',
1046
+ 'value': 120312,
1047
1047
  'expect': true
1048
1048
  },
1049
1049
  {
1050
- 'inputName': 'number 1.23',
1051
- 'inputValue': 1.23,
1050
+ 'title': 'number 1.23',
1051
+ 'value': 1.23,
1052
1052
  'expect': true
1053
1053
  },
1054
1054
  {
1055
- 'inputName': 'number -1.23',
1056
- 'inputValue': -1.23,
1055
+ 'title': 'number -1.23',
1056
+ 'value': -1.23,
1057
1057
  'expect': true
1058
1058
  },
1059
1059
  {
1060
- 'inputName': 'string \'-1\'',
1061
- 'inputValue': (-1).toString(),
1060
+ 'title': 'string \'-1\'',
1061
+ 'value': (-1).toString(),
1062
1062
  'expect': true
1063
1063
  },
1064
1064
  {
1065
- 'inputName': 'string \'120312\'',
1066
- 'inputValue': (120312).toString(),
1065
+ 'title': 'string \'120312\'',
1066
+ 'value': (120312).toString(),
1067
1067
  'expect': true
1068
1068
  },
1069
1069
  {
1070
- 'inputName': 'string \'1.23\'',
1071
- 'inputValue': (1.23).toString(),
1070
+ 'title': 'string \'1.23\'',
1071
+ 'value': (1.23).toString(),
1072
1072
  'expect': true
1073
1073
  },
1074
1074
  {
1075
- 'inputName': 'string \'-1.23\'',
1076
- 'inputValue': (-1.23).toString(),
1075
+ 'title': 'string \'-1.23\'',
1076
+ 'value': (-1.23).toString(),
1077
1077
  'expect': true
1078
1078
  },
1079
- ...defaultItemss({
1079
+ ...defaultItems({
1080
1080
  'number 0': true,
1081
1081
  'number 1': true
1082
1082
  })
@@ -1087,46 +1087,46 @@ const testItems: ITestSuite = {
1087
1087
  'rule': ['$.string', 'ufloat'],
1088
1088
  'items': [
1089
1089
  {
1090
- 'inputName': 'number -1',
1091
- 'inputValue': -1,
1090
+ 'title': 'number -1',
1091
+ 'value': -1,
1092
1092
  'expect': false
1093
1093
  },
1094
1094
  {
1095
- 'inputName': 'number 120312',
1096
- 'inputValue': 120312,
1095
+ 'title': 'number 120312',
1096
+ 'value': 120312,
1097
1097
  'expect': true
1098
1098
  },
1099
1099
  {
1100
- 'inputName': 'number 1.23',
1101
- 'inputValue': 1.23,
1100
+ 'title': 'number 1.23',
1101
+ 'value': 1.23,
1102
1102
  'expect': true
1103
1103
  },
1104
1104
  {
1105
- 'inputName': 'number -1.23',
1106
- 'inputValue': -1.23,
1105
+ 'title': 'number -1.23',
1106
+ 'value': -1.23,
1107
1107
  'expect': false
1108
1108
  },
1109
1109
  {
1110
- 'inputName': 'string \'-1\'',
1111
- 'inputValue': (-1).toString(),
1110
+ 'title': 'string \'-1\'',
1111
+ 'value': (-1).toString(),
1112
1112
  'expect': false
1113
1113
  },
1114
1114
  {
1115
- 'inputName': 'string \'120312\'',
1116
- 'inputValue': (120312).toString(),
1115
+ 'title': 'string \'120312\'',
1116
+ 'value': (120312).toString(),
1117
1117
  'expect': true
1118
1118
  },
1119
1119
  {
1120
- 'inputName': 'string \'1.23\'',
1121
- 'inputValue': (1.23).toString(),
1120
+ 'title': 'string \'1.23\'',
1121
+ 'value': (1.23).toString(),
1122
1122
  'expect': true
1123
1123
  },
1124
1124
  {
1125
- 'inputName': 'string \'-1.23\'',
1126
- 'inputValue': (-1.23).toString(),
1125
+ 'title': 'string \'-1.23\'',
1126
+ 'value': (-1.23).toString(),
1127
1127
  'expect': false
1128
1128
  },
1129
- ...defaultItemss({
1129
+ ...defaultItems({
1130
1130
  'number 0': true,
1131
1131
  'number 1': true
1132
1132
  })
@@ -1137,46 +1137,46 @@ const testItems: ITestSuite = {
1137
1137
  'rule': ['$.string', 'number'],
1138
1138
  'items': [
1139
1139
  {
1140
- 'inputName': 'number -1',
1141
- 'inputValue': -1,
1140
+ 'title': 'number -1',
1141
+ 'value': -1,
1142
1142
  'expect': true
1143
1143
  },
1144
1144
  {
1145
- 'inputName': 'number 120312',
1146
- 'inputValue': 120312,
1145
+ 'title': 'number 120312',
1146
+ 'value': 120312,
1147
1147
  'expect': true
1148
1148
  },
1149
1149
  {
1150
- 'inputName': 'number 1.23',
1151
- 'inputValue': 1.23,
1150
+ 'title': 'number 1.23',
1151
+ 'value': 1.23,
1152
1152
  'expect': true
1153
1153
  },
1154
1154
  {
1155
- 'inputName': 'number -1.23',
1156
- 'inputValue': -1.23,
1155
+ 'title': 'number -1.23',
1156
+ 'value': -1.23,
1157
1157
  'expect': true
1158
1158
  },
1159
1159
  {
1160
- 'inputName': 'string \'-1\'',
1161
- 'inputValue': (-1).toString(),
1160
+ 'title': 'string \'-1\'',
1161
+ 'value': (-1).toString(),
1162
1162
  'expect': true
1163
1163
  },
1164
1164
  {
1165
- 'inputName': 'string \'120312\'',
1166
- 'inputValue': (120312).toString(),
1165
+ 'title': 'string \'120312\'',
1166
+ 'value': (120312).toString(),
1167
1167
  'expect': true
1168
1168
  },
1169
1169
  {
1170
- 'inputName': 'string \'1.23\'',
1171
- 'inputValue': (1.23).toString(),
1170
+ 'title': 'string \'1.23\'',
1171
+ 'value': (1.23).toString(),
1172
1172
  'expect': true
1173
1173
  },
1174
1174
  {
1175
- 'inputName': 'string \'-1.23\'',
1176
- 'inputValue': (-1.23).toString(),
1175
+ 'title': 'string \'-1.23\'',
1176
+ 'value': (-1.23).toString(),
1177
1177
  'expect': true
1178
1178
  },
1179
- ...defaultItemss({
1179
+ ...defaultItems({
1180
1180
  'number 0': true,
1181
1181
  'number 1': true
1182
1182
  })
@@ -1187,76 +1187,76 @@ const testItems: ITestSuite = {
1187
1187
  'rule': ['$.string', 'number(1.0, 10.0)'],
1188
1188
  'items': [
1189
1189
  {
1190
- 'inputName': 'number -1',
1191
- 'inputValue': -1,
1190
+ 'title': 'number -1',
1191
+ 'value': -1,
1192
1192
  'expect': false
1193
1193
  },
1194
1194
  {
1195
- 'inputName': 'number 1',
1196
- 'inputValue': 1,
1195
+ 'title': 'number 1',
1196
+ 'value': 1,
1197
1197
  'expect': true
1198
1198
  },
1199
1199
  {
1200
- 'inputName': 'number 10',
1201
- 'inputValue': 10,
1200
+ 'title': 'number 10',
1201
+ 'value': 10,
1202
1202
  'expect': true
1203
1203
  },
1204
1204
  {
1205
- 'inputName': 'number 11',
1206
- 'inputValue': 11,
1205
+ 'title': 'number 11',
1206
+ 'value': 11,
1207
1207
  'expect': false
1208
1208
  },
1209
1209
  {
1210
- 'inputName': 'number 0',
1211
- 'inputValue': 0,
1210
+ 'title': 'number 0',
1211
+ 'value': 0,
1212
1212
  'expect': false
1213
1213
  },
1214
1214
  {
1215
- 'inputName': 'number 1.23',
1216
- 'inputValue': 1.23,
1215
+ 'title': 'number 1.23',
1216
+ 'value': 1.23,
1217
1217
  'expect': true
1218
1218
  },
1219
1219
  {
1220
- 'inputName': 'number -1.23',
1221
- 'inputValue': -1.23,
1220
+ 'title': 'number -1.23',
1221
+ 'value': -1.23,
1222
1222
  'expect': false
1223
1223
  },
1224
1224
  {
1225
- 'inputName': 'string \'-1\'',
1226
- 'inputValue': (-1).toString(),
1225
+ 'title': 'string \'-1\'',
1226
+ 'value': (-1).toString(),
1227
1227
  'expect': false
1228
1228
  },
1229
1229
  {
1230
- 'inputName': 'string \'1\'',
1231
- 'inputValue': (1).toString(),
1230
+ 'title': 'string \'1\'',
1231
+ 'value': (1).toString(),
1232
1232
  'expect': true
1233
1233
  },
1234
1234
  {
1235
- 'inputName': 'string \'10\'',
1236
- 'inputValue': (10).toString(),
1235
+ 'title': 'string \'10\'',
1236
+ 'value': (10).toString(),
1237
1237
  'expect': true
1238
1238
  },
1239
1239
  {
1240
- 'inputName': 'string \'11\'',
1241
- 'inputValue': (11).toString(),
1240
+ 'title': 'string \'11\'',
1241
+ 'value': (11).toString(),
1242
1242
  'expect': false
1243
1243
  },
1244
1244
  {
1245
- 'inputName': 'string \'0\'',
1246
- 'inputValue': (0).toString(),
1245
+ 'title': 'string \'0\'',
1246
+ 'value': (0).toString(),
1247
1247
  'expect': false
1248
1248
  },
1249
1249
  {
1250
- 'inputName': 'string \'1.23\'',
1251
- 'inputValue': (1.23).toString(),
1250
+ 'title': 'string \'1.23\'',
1251
+ 'value': (1.23).toString(),
1252
1252
  'expect': true
1253
1253
  },
1254
1254
  {
1255
- 'inputName': 'string \'-1.23\'',
1256
- 'inputValue': (-1.23).toString(),
1255
+ 'title': 'string \'-1.23\'',
1256
+ 'value': (-1.23).toString(),
1257
1257
  'expect': false
1258
1258
  },
1259
- ...defaultItemss({
1259
+ ...defaultItems({
1260
1260
  'number 0': false,
1261
1261
  'number 1': true
1262
1262
  })
@@ -1267,76 +1267,76 @@ const testItems: ITestSuite = {
1267
1267
  'rule': ['$.string', 'number(1, )'],
1268
1268
  'items': [
1269
1269
  {
1270
- 'inputName': 'number -1',
1271
- 'inputValue': -1,
1270
+ 'title': 'number -1',
1271
+ 'value': -1,
1272
1272
  'expect': false
1273
1273
  },
1274
1274
  {
1275
- 'inputName': 'number 1',
1276
- 'inputValue': 1,
1275
+ 'title': 'number 1',
1276
+ 'value': 1,
1277
1277
  'expect': true
1278
1278
  },
1279
1279
  {
1280
- 'inputName': 'number 10',
1281
- 'inputValue': 10,
1280
+ 'title': 'number 10',
1281
+ 'value': 10,
1282
1282
  'expect': true
1283
1283
  },
1284
1284
  {
1285
- 'inputName': 'number 11',
1286
- 'inputValue': 11,
1285
+ 'title': 'number 11',
1286
+ 'value': 11,
1287
1287
  'expect': true
1288
1288
  },
1289
1289
  {
1290
- 'inputName': 'number 0',
1291
- 'inputValue': 0,
1290
+ 'title': 'number 0',
1291
+ 'value': 0,
1292
1292
  'expect': false
1293
1293
  },
1294
1294
  {
1295
- 'inputName': 'number 1.23',
1296
- 'inputValue': 1.23,
1295
+ 'title': 'number 1.23',
1296
+ 'value': 1.23,
1297
1297
  'expect': true
1298
1298
  },
1299
1299
  {
1300
- 'inputName': 'number -1.23',
1301
- 'inputValue': -1.23,
1300
+ 'title': 'number -1.23',
1301
+ 'value': -1.23,
1302
1302
  'expect': false
1303
1303
  },
1304
1304
  {
1305
- 'inputName': 'string \'-1\'',
1306
- 'inputValue': (-1).toString(),
1305
+ 'title': 'string \'-1\'',
1306
+ 'value': (-1).toString(),
1307
1307
  'expect': false
1308
1308
  },
1309
1309
  {
1310
- 'inputName': 'string \'1\'',
1311
- 'inputValue': (1).toString(),
1310
+ 'title': 'string \'1\'',
1311
+ 'value': (1).toString(),
1312
1312
  'expect': true
1313
1313
  },
1314
1314
  {
1315
- 'inputName': 'string \'10\'',
1316
- 'inputValue': (10).toString(),
1315
+ 'title': 'string \'10\'',
1316
+ 'value': (10).toString(),
1317
1317
  'expect': true
1318
1318
  },
1319
1319
  {
1320
- 'inputName': 'string \'11\'',
1321
- 'inputValue': (11).toString(),
1320
+ 'title': 'string \'11\'',
1321
+ 'value': (11).toString(),
1322
1322
  'expect': true
1323
1323
  },
1324
1324
  {
1325
- 'inputName': 'string \'0\'',
1326
- 'inputValue': (0).toString(),
1325
+ 'title': 'string \'0\'',
1326
+ 'value': (0).toString(),
1327
1327
  'expect': false
1328
1328
  },
1329
1329
  {
1330
- 'inputName': 'string \'1.23\'',
1331
- 'inputValue': (1.23).toString(),
1330
+ 'title': 'string \'1.23\'',
1331
+ 'value': (1.23).toString(),
1332
1332
  'expect': true
1333
1333
  },
1334
1334
  {
1335
- 'inputName': 'string \'-1.23\'',
1336
- 'inputValue': (-1.23).toString(),
1335
+ 'title': 'string \'-1.23\'',
1336
+ 'value': (-1.23).toString(),
1337
1337
  'expect': false
1338
1338
  },
1339
- ...defaultItemss({
1339
+ ...defaultItems({
1340
1340
  'number 0': false,
1341
1341
  'number 1': true
1342
1342
  })
@@ -1347,66 +1347,66 @@ const testItems: ITestSuite = {
1347
1347
  'rule': ['$.string', 'number(, -1)'],
1348
1348
  'items': [
1349
1349
  {
1350
- 'inputName': 'number -1',
1351
- 'inputValue': -1,
1350
+ 'title': 'number -1',
1351
+ 'value': -1,
1352
1352
  'expect': true
1353
1353
  },
1354
1354
  {
1355
- 'inputName': 'number 1',
1356
- 'inputValue': 1,
1355
+ 'title': 'number 1',
1356
+ 'value': 1,
1357
1357
  'expect': false
1358
1358
  },
1359
1359
  {
1360
- 'inputName': 'number -0.3',
1361
- 'inputValue': -0.3,
1360
+ 'title': 'number -0.3',
1361
+ 'value': -0.3,
1362
1362
  'expect': false
1363
1363
  },
1364
1364
  {
1365
- 'inputName': 'number -11',
1366
- 'inputValue': -11,
1365
+ 'title': 'number -11',
1366
+ 'value': -11,
1367
1367
  'expect': true
1368
1368
  },
1369
1369
  {
1370
- 'inputName': 'number 0',
1371
- 'inputValue': 0,
1370
+ 'title': 'number 0',
1371
+ 'value': 0,
1372
1372
  'expect': false
1373
1373
  },
1374
1374
  {
1375
- 'inputName': 'number -1.23',
1376
- 'inputValue': -1.23,
1375
+ 'title': 'number -1.23',
1376
+ 'value': -1.23,
1377
1377
  'expect': true
1378
1378
  },
1379
1379
  {
1380
- 'inputName': 'string \'-1\'',
1381
- 'inputValue': (-1).toString(),
1380
+ 'title': 'string \'-1\'',
1381
+ 'value': (-1).toString(),
1382
1382
  'expect': true
1383
1383
  },
1384
1384
  {
1385
- 'inputName': 'string \'1\'',
1386
- 'inputValue': (1).toString(),
1385
+ 'title': 'string \'1\'',
1386
+ 'value': (1).toString(),
1387
1387
  'expect': false
1388
1388
  },
1389
1389
  {
1390
- 'inputName': 'string \'-0.3\'',
1391
- 'inputValue': (-0.3).toString(),
1390
+ 'title': 'string \'-0.3\'',
1391
+ 'value': (-0.3).toString(),
1392
1392
  'expect': false
1393
1393
  },
1394
1394
  {
1395
- 'inputName': 'string \'-11\'',
1396
- 'inputValue': (-11).toString(),
1395
+ 'title': 'string \'-11\'',
1396
+ 'value': (-11).toString(),
1397
1397
  'expect': true
1398
1398
  },
1399
1399
  {
1400
- 'inputName': 'string \'0\'',
1401
- 'inputValue': (0).toString(),
1400
+ 'title': 'string \'0\'',
1401
+ 'value': (0).toString(),
1402
1402
  'expect': false
1403
1403
  },
1404
1404
  {
1405
- 'inputName': 'string \'-1.23\'',
1406
- 'inputValue': (-1.23).toString(),
1405
+ 'title': 'string \'-1.23\'',
1406
+ 'value': (-1.23).toString(),
1407
1407
  'expect': true
1408
1408
  },
1409
- ...defaultItemss({
1409
+ ...defaultItems({
1410
1410
  'number 0': false,
1411
1411
  'number 1': false
1412
1412
  })
@@ -1417,11 +1417,11 @@ const testItems: ITestSuite = {
1417
1417
  'rule': ['$.string', 'null'],
1418
1418
  'items': [
1419
1419
  {
1420
- 'inputName': 'string \'null\'',
1421
- 'inputValue': 'null',
1420
+ 'title': 'string \'null\'',
1421
+ 'value': 'null',
1422
1422
  'expect': true
1423
1423
  },
1424
- ...defaultItemss({
1424
+ ...defaultItems({
1425
1425
  'null': true
1426
1426
  })
1427
1427
  ]
@@ -1431,11 +1431,11 @@ const testItems: ITestSuite = {
1431
1431
  'rule': ['$.string', null],
1432
1432
  'items': [
1433
1433
  {
1434
- 'inputName': 'string \'null\'',
1435
- 'inputValue': 'null',
1434
+ 'title': 'string \'null\'',
1435
+ 'value': 'null',
1436
1436
  'expect': true
1437
1437
  },
1438
- ...defaultItemss({
1438
+ ...defaultItems({
1439
1439
  'null': true
1440
1440
  })
1441
1441
  ]
@@ -1445,11 +1445,11 @@ const testItems: ITestSuite = {
1445
1445
  'rule': ['$.string', 1],
1446
1446
  'items': [
1447
1447
  {
1448
- 'inputName': 'string \'1\'',
1449
- 'inputValue': '1',
1448
+ 'title': 'string \'1\'',
1449
+ 'value': '1',
1450
1450
  'expect': true
1451
1451
  },
1452
- ...defaultItemss({
1452
+ ...defaultItems({
1453
1453
  'number 1': true
1454
1454
  })
1455
1455
  ]
@@ -1459,11 +1459,11 @@ const testItems: ITestSuite = {
1459
1459
  'rule': ['$.string', true],
1460
1460
  'items': [
1461
1461
  {
1462
- 'inputName': 'string \'true\'',
1463
- 'inputValue': 'true',
1462
+ 'title': 'string \'true\'',
1463
+ 'value': 'true',
1464
1464
  'expect': true
1465
1465
  },
1466
- ...defaultItemss({
1466
+ ...defaultItems({
1467
1467
  'true': true
1468
1468
  })
1469
1469
  ]
@@ -1473,11 +1473,11 @@ const testItems: ITestSuite = {
1473
1473
  'rule': ['$.string', false],
1474
1474
  'items': [
1475
1475
  {
1476
- 'inputName': 'string \'false\'',
1477
- 'inputValue': 'false',
1476
+ 'title': 'string \'false\'',
1477
+ 'value': 'false',
1478
1478
  'expect': true
1479
1479
  },
1480
- ...defaultItemss({
1480
+ ...defaultItems({
1481
1481
  'false': true
1482
1482
  })
1483
1483
  ]