@litert/typeguard 1.0.0 → 1.2.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 (74) hide show
  1. package/CHANGES.md +15 -0
  2. package/lib/BuiltInTypeCompiler.d.ts +4 -4
  3. package/lib/BuiltInTypeCompiler.d.ts.map +1 -1
  4. package/lib/BuiltInTypeCompiler.js +167 -166
  5. package/lib/BuiltInTypeCompiler.js.map +1 -1
  6. package/lib/BuiltInTypes.d.ts +1 -1
  7. package/lib/BuiltInTypes.js +37 -36
  8. package/lib/BuiltInTypes.js.map +1 -1
  9. package/lib/Common.d.ts +13 -9
  10. package/lib/Common.d.ts.map +1 -1
  11. package/lib/Common.js +1 -1
  12. package/lib/Compiler.d.ts +2 -2
  13. package/lib/Compiler.d.ts.map +1 -1
  14. package/lib/Compiler.js +77 -72
  15. package/lib/Compiler.js.map +1 -1
  16. package/lib/Context.d.ts +2 -2
  17. package/lib/Context.js +3 -2
  18. package/lib/Context.js.map +1 -1
  19. package/lib/FilterCompiler.d.ts +5 -5
  20. package/lib/FilterCompiler.d.ts.map +1 -1
  21. package/lib/FilterCompiler.js +25 -24
  22. package/lib/FilterCompiler.js.map +1 -1
  23. package/lib/InlineCompiler.d.ts +12 -5
  24. package/lib/InlineCompiler.d.ts.map +1 -1
  25. package/lib/InlineCompiler.js +14 -5
  26. package/lib/InlineCompiler.js.map +1 -1
  27. package/lib/Internal.d.ts +2 -1
  28. package/lib/Internal.d.ts.map +1 -1
  29. package/lib/Internal.js +12 -10
  30. package/lib/Internal.js.map +1 -1
  31. package/lib/Modifiers.d.ts +1 -1
  32. package/lib/Modifiers.js +2 -1
  33. package/lib/Modifiers.js.map +1 -1
  34. package/lib/index.d.ts +5 -5
  35. package/lib/index.js +19 -7
  36. package/lib/index.js.map +1 -1
  37. package/lib/langs/JavaScript.d.ts +2 -2
  38. package/lib/langs/JavaScript.d.ts.map +1 -1
  39. package/lib/langs/JavaScript.js +30 -23
  40. package/lib/langs/JavaScript.js.map +1 -1
  41. package/package.json +18 -13
  42. package/src/{samples → examples}/quick-start.ts +22 -12
  43. package/src/lib/BuiltInTypeCompiler.ts +171 -171
  44. package/src/lib/BuiltInTypes.ts +36 -36
  45. package/src/lib/Common.ts +15 -10
  46. package/src/lib/Compiler.ts +213 -208
  47. package/src/lib/Context.ts +3 -3
  48. package/src/lib/FilterCompiler.ts +84 -84
  49. package/src/lib/InlineCompiler.ts +35 -14
  50. package/src/lib/Internal.ts +12 -10
  51. package/src/lib/Modifiers.ts +2 -2
  52. package/src/lib/index.ts +5 -5
  53. package/src/lib/langs/JavaScript.ts +34 -24
  54. package/src/test/00-all.ts +11 -9
  55. package/src/test/01-elemental-types.ts +1111 -1110
  56. package/src/test/02-array-and-list.ts +75 -75
  57. package/src/test/03-tuple.ts +87 -87
  58. package/src/test/04-from-string.ts +849 -848
  59. package/src/test/05-string-asserts.ts +422 -422
  60. package/src/test/06-structure.ts +107 -107
  61. package/src/test/07-modifiers.ts +151 -42
  62. package/src/test/08-map-and-dict.ts +46 -46
  63. package/src/test/09-exceptions.ts +67 -0
  64. package/src/test/abstracts.ts +52 -43
  65. package/dist/typeguard.amd.d.ts +0 -588
  66. package/dist/typeguard.amd.d.ts.map +0 -1
  67. package/dist/typeguard.amd.js +0 -2063
  68. package/dist/typeguard.amd.js.map +0 -1
  69. package/dist/typeguard.system.d.ts +0 -588
  70. package/dist/typeguard.system.d.ts.map +0 -1
  71. package/dist/typeguard.system.js +0 -2179
  72. package/dist/typeguard.system.js.map +0 -1
  73. package/tsconfig-amd.json +0 -72
  74. package/tsconfig-systemjs.json +0 -72
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2019 Angus.Fenying <fenying@litert.org>
2
+ * Copyright 2022 Angus Fenying <fenying@litert.org>
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -14,414 +14,414 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { createTestDefinition, defaultItemss, ITestSuite } from "./abstracts";
17
+ import { createTestDefinition, defaultItemss, ITestSuite } from './abstracts';
18
18
 
19
19
  const testItems: ITestSuite = {
20
20
 
21
- name: "String Asserts",
21
+ name: 'String Asserts',
22
22
  sections: [
23
23
  {
24
- "name": "Operator ==",
25
- "rule": "==aasdsadsada",
26
- "items": [
24
+ 'name': 'Operator ==',
25
+ 'rule': '==aasdsadsada',
26
+ 'items': [
27
27
  {
28
- "inputName": "string 'aasdsadsada'",
29
- "inputValue": "aasdsadsada",
30
- "expect": true
28
+ 'inputName': 'string \'aasdsadsada\'',
29
+ 'inputValue': 'aasdsadsada',
30
+ 'expect': true
31
31
  },
32
32
  {
33
- "inputName": "string 'AASDSADSADA'",
34
- "inputValue": "AASDSADSADA",
35
- "expect": false
33
+ 'inputName': 'string \'AASDSADSADA\'',
34
+ 'inputValue': 'AASDSADSADA',
35
+ 'expect': false
36
36
  },
37
37
  ...defaultItemss({})
38
38
  ]
39
39
  },
40
40
  {
41
- "name": "Operator =",
42
- "rule": "=aasdsadsada",
43
- "items": [
41
+ 'name': 'Operator =',
42
+ 'rule': '=aasdsadsada',
43
+ 'items': [
44
44
  {
45
- "inputName": "string 'aasdsadsada'",
46
- "inputValue": "aasdsadsada",
47
- "expect": true
45
+ 'inputName': 'string \'aasdsadsada\'',
46
+ 'inputValue': 'aasdsadsada',
47
+ 'expect': true
48
48
  },
49
49
  {
50
- "inputName": "string 'AASDSADSADA'",
51
- "inputValue": "AASDSADSADA",
52
- "expect": false
50
+ 'inputName': 'string \'AASDSADSADA\'',
51
+ 'inputValue': 'AASDSADSADA',
52
+ 'expect': false
53
53
  },
54
54
  ...defaultItemss({})
55
55
  ]
56
56
  },
57
57
  {
58
- "name": "Symbol ':equal:'",
59
- "rule": ":equal:aasdsadsada",
60
- "items": [
58
+ 'name': 'Symbol \':equal:\'',
59
+ 'rule': ':equal:aasdsadsada',
60
+ 'items': [
61
61
  {
62
- "inputName": "string 'aasdsadsada'",
63
- "inputValue": "aasdsadsada",
64
- "expect": true
62
+ 'inputName': 'string \'aasdsadsada\'',
63
+ 'inputValue': 'aasdsadsada',
64
+ 'expect': true
65
65
  },
66
66
  {
67
- "inputName": "string 'AASDSADSADA'",
68
- "inputValue": "AASDSADSADA",
69
- "expect": false
67
+ 'inputName': 'string \'AASDSADSADA\'',
68
+ 'inputValue': 'AASDSADSADA',
69
+ 'expect': false
70
70
  },
71
71
  ...defaultItemss({})
72
72
  ]
73
73
  },
74
74
  {
75
- "name": "Symbol ':equal-i:'",
76
- "rule": ":equal-i:aasdsadsada",
77
- "items": [
75
+ 'name': 'Symbol \':equal-i:\'',
76
+ 'rule': ':equal-i:aasdsadsada',
77
+ 'items': [
78
78
  {
79
- "inputName": "string 'aasdsadsada'",
80
- "inputValue": "aasdsadsada",
81
- "expect": true
79
+ 'inputName': 'string \'aasdsadsada\'',
80
+ 'inputValue': 'aasdsadsada',
81
+ 'expect': true
82
82
  },
83
83
  {
84
- "inputName": "string 'AASDSADSADA'",
85
- "inputValue": "AASDSADSADA",
86
- "expect": true
84
+ 'inputName': 'string \'AASDSADSADA\'',
85
+ 'inputValue': 'AASDSADSADA',
86
+ 'expect': true
87
87
  },
88
88
  ...defaultItemss({})
89
89
  ]
90
90
  },
91
91
  {
92
- "name": "Operator %=",
93
- "rule": "%=aasdsadsada",
94
- "items": [
92
+ 'name': 'Operator %=',
93
+ 'rule': '%=aasdsadsada',
94
+ 'items': [
95
95
  {
96
- "inputName": "string 'aasdsadsada'",
97
- "inputValue": "aasdsadsada",
98
- "expect": true
96
+ 'inputName': 'string \'aasdsadsada\'',
97
+ 'inputValue': 'aasdsadsada',
98
+ 'expect': true
99
99
  },
100
100
  {
101
- "inputName": "string 'AASDSADSADA'",
102
- "inputValue": "AASDSADSADA",
103
- "expect": true
101
+ 'inputName': 'string \'AASDSADSADA\'',
102
+ 'inputValue': 'AASDSADSADA',
103
+ 'expect': true
104
104
  },
105
105
  ...defaultItemss({})
106
106
  ]
107
107
  },
108
108
  {
109
- "name": "Operator !=",
110
- "rule": "!=aasdsadsada",
111
- "items": [
109
+ 'name': 'Operator !=',
110
+ 'rule': '!=aasdsadsada',
111
+ 'items': [
112
112
  {
113
- "inputName": "string 'aasdsadsada'",
114
- "inputValue": "aasdsadsada",
115
- "expect": false
113
+ 'inputName': 'string \'aasdsadsada\'',
114
+ 'inputValue': 'aasdsadsada',
115
+ 'expect': false
116
116
  },
117
117
  {
118
- "inputName": "string 'AASDSADSADA'",
119
- "inputValue": "AASDSADSADA",
120
- "expect": true
118
+ 'inputName': 'string \'AASDSADSADA\'',
119
+ 'inputValue': 'AASDSADSADA',
120
+ 'expect': true
121
121
  },
122
122
  ...defaultItemss({
123
- "string 'hello'": true,
124
- "empty string": true
123
+ 'string \'hello\'': true,
124
+ 'empty string': true
125
125
  })
126
126
  ]
127
127
  },
128
128
  {
129
- "name": "Symbol ':not-equal:'",
130
- "rule": ":not-equal:aasdsadsada",
131
- "items": [
129
+ 'name': 'Symbol \':not-equal:\'',
130
+ 'rule': ':not-equal:aasdsadsada',
131
+ 'items': [
132
132
  {
133
- "inputName": "string 'aasdsadsada'",
134
- "inputValue": "aasdsadsada",
135
- "expect": false
133
+ 'inputName': 'string \'aasdsadsada\'',
134
+ 'inputValue': 'aasdsadsada',
135
+ 'expect': false
136
136
  },
137
137
  {
138
- "inputName": "string 'AASDSADSADA'",
139
- "inputValue": "AASDSADSADA",
140
- "expect": true
138
+ 'inputName': 'string \'AASDSADSADA\'',
139
+ 'inputValue': 'AASDSADSADA',
140
+ 'expect': true
141
141
  },
142
142
  ...defaultItemss({
143
- "string 'hello'": true,
144
- "empty string": true
143
+ 'string \'hello\'': true,
144
+ 'empty string': true
145
145
  })
146
146
  ]
147
147
  },
148
148
  {
149
- "name": "Symbol ':not-equal-i:'",
150
- "rule": ":not-equal-i:aasdsadsada",
151
- "items": [
149
+ 'name': 'Symbol \':not-equal-i:\'',
150
+ 'rule': ':not-equal-i:aasdsadsada',
151
+ 'items': [
152
152
  {
153
- "inputName": "string 'aasdsadsada'",
154
- "inputValue": "aasdsadsada",
155
- "expect": false
153
+ 'inputName': 'string \'aasdsadsada\'',
154
+ 'inputValue': 'aasdsadsada',
155
+ 'expect': false
156
156
  },
157
157
  {
158
- "inputName": "string 'AASDSADSADA'",
159
- "inputValue": "AASDSADSADA",
160
- "expect": false
158
+ 'inputName': 'string \'AASDSADSADA\'',
159
+ 'inputValue': 'AASDSADSADA',
160
+ 'expect': false
161
161
  },
162
162
  ...defaultItemss({
163
- "string 'hello'": true,
164
- "empty string": true
163
+ 'string \'hello\'': true,
164
+ 'empty string': true
165
165
  })
166
166
  ]
167
167
  },
168
168
  {
169
- "name": "Operator %!",
170
- "rule": "%!aasdsadsada",
171
- "items": [
169
+ 'name': 'Operator %!',
170
+ 'rule': '%!aasdsadsada',
171
+ 'items': [
172
172
  {
173
- "inputName": "string 'aasdsadsada'",
174
- "inputValue": "aasdsadsada",
175
- "expect": false
173
+ 'inputName': 'string \'aasdsadsada\'',
174
+ 'inputValue': 'aasdsadsada',
175
+ 'expect': false
176
176
  },
177
177
  {
178
- "inputName": "string 'AASDSADSADA'",
179
- "inputValue": "AASDSADSADA",
180
- "expect": false
178
+ 'inputName': 'string \'AASDSADSADA\'',
179
+ 'inputValue': 'AASDSADSADA',
180
+ 'expect': false
181
181
  },
182
182
  ...defaultItemss({
183
- "string 'hello'": true,
184
- "empty string": true
183
+ 'string \'hello\'': true,
184
+ 'empty string': true
185
185
  })
186
186
  ]
187
187
  },
188
188
  {
189
- "name": "Operator ^=",
190
- "rule": "^=hello",
191
- "items": [
189
+ 'name': 'Operator ^=',
190
+ 'rule': '^=hello',
191
+ 'items': [
192
192
  {
193
- "inputName": "string 'hello world'",
194
- "inputValue": "hello world",
195
- "expect": true
193
+ 'inputName': 'string \'hello world\'',
194
+ 'inputValue': 'hello world',
195
+ 'expect': true
196
196
  },
197
197
  {
198
- "inputName": "string 'hello world'",
199
- "inputValue": "Hello world",
200
- "expect": false
198
+ 'inputName': 'string \'hello world\'',
199
+ 'inputValue': 'Hello world',
200
+ 'expect': false
201
201
  },
202
202
  ...defaultItemss({
203
- "string 'hello'": true,
204
- "empty string": false
203
+ 'string \'hello\'': true,
204
+ 'empty string': false
205
205
  })
206
206
  ]
207
207
  },
208
208
  {
209
- "name": "Symbol ':start-with:'",
210
- "rule": ":start-with:hello",
211
- "items": [
209
+ 'name': 'Symbol \':start-with:\'',
210
+ 'rule': ':start-with:hello',
211
+ 'items': [
212
212
  {
213
- "inputName": "string 'hello world'",
214
- "inputValue": "hello world",
215
- "expect": true
213
+ 'inputName': 'string \'hello world\'',
214
+ 'inputValue': 'hello world',
215
+ 'expect': true
216
216
  },
217
217
  {
218
- "inputName": "string 'hello world'",
219
- "inputValue": "Hello world",
220
- "expect": false
218
+ 'inputName': 'string \'hello world\'',
219
+ 'inputValue': 'Hello world',
220
+ 'expect': false
221
221
  },
222
222
  ...defaultItemss({
223
- "string 'hello'": true,
224
- "empty string": false
223
+ 'string \'hello\'': true,
224
+ 'empty string': false
225
225
  })
226
226
  ]
227
227
  },
228
228
  {
229
- "name": "Symbol ':start-with-i:'",
230
- "rule": ":start-with-i:hello",
231
- "items": [
229
+ 'name': 'Symbol \':start-with-i:\'',
230
+ 'rule': ':start-with-i:hello',
231
+ 'items': [
232
232
  {
233
- "inputName": "string 'hello world'",
234
- "inputValue": "hello world",
235
- "expect": true
233
+ 'inputName': 'string \'hello world\'',
234
+ 'inputValue': 'hello world',
235
+ 'expect': true
236
236
  },
237
237
  {
238
- "inputName": "string 'hello world'",
239
- "inputValue": "Hello world",
240
- "expect": true
238
+ 'inputName': 'string \'hello world\'',
239
+ 'inputValue': 'Hello world',
240
+ 'expect': true
241
241
  },
242
242
  ...defaultItemss({
243
- "string 'hello'": true,
244
- "empty string": false
243
+ 'string \'hello\'': true,
244
+ 'empty string': false
245
245
  })
246
246
  ]
247
247
  },
248
248
  {
249
- "name": "Operator ^!",
250
- "rule": "^!hello",
251
- "items": [
249
+ 'name': 'Operator ^!',
250
+ 'rule': '^!hello',
251
+ 'items': [
252
252
  {
253
- "inputName": "string 'hello world'",
254
- "inputValue": "hello world",
255
- "expect": false
253
+ 'inputName': 'string \'hello world\'',
254
+ 'inputValue': 'hello world',
255
+ 'expect': false
256
256
  },
257
257
  {
258
- "inputName": "string 'hello world'",
259
- "inputValue": "Hello world",
260
- "expect": true
258
+ 'inputName': 'string \'hello world\'',
259
+ 'inputValue': 'Hello world',
260
+ 'expect': true
261
261
  },
262
262
  ...defaultItemss({
263
- "string 'hello'": false,
264
- "empty string": true
263
+ 'string \'hello\'': false,
264
+ 'empty string': true
265
265
  })
266
266
  ]
267
267
  },
268
268
  {
269
- "name": "Symbol ':not-start-with:'",
270
- "rule": ":not-start-with:hello",
271
- "items": [
269
+ 'name': 'Symbol \':not-start-with:\'',
270
+ 'rule': ':not-start-with:hello',
271
+ 'items': [
272
272
  {
273
- "inputName": "string 'hello world'",
274
- "inputValue": "hello world",
275
- "expect": false
273
+ 'inputName': 'string \'hello world\'',
274
+ 'inputValue': 'hello world',
275
+ 'expect': false
276
276
  },
277
277
  {
278
- "inputName": "string 'hello world'",
279
- "inputValue": "Hello world",
280
- "expect": true
278
+ 'inputName': 'string \'hello world\'',
279
+ 'inputValue': 'Hello world',
280
+ 'expect': true
281
281
  },
282
282
  ...defaultItemss({
283
- "string 'hello'": false,
284
- "empty string": true
283
+ 'string \'hello\'': false,
284
+ 'empty string': true
285
285
  })
286
286
  ]
287
287
  },
288
288
  {
289
- "name": "Symbol ':not-start-with-i:'",
290
- "rule": ":not-start-with-i:hello",
291
- "items": [
289
+ 'name': 'Symbol \':not-start-with-i:\'',
290
+ 'rule': ':not-start-with-i:hello',
291
+ 'items': [
292
292
  {
293
- "inputName": "string 'hello world'",
294
- "inputValue": "hello world",
295
- "expect": false
293
+ 'inputName': 'string \'hello world\'',
294
+ 'inputValue': 'hello world',
295
+ 'expect': false
296
296
  },
297
297
  {
298
- "inputName": "string 'hello world'",
299
- "inputValue": "Hello world",
300
- "expect": false
298
+ 'inputName': 'string \'hello world\'',
299
+ 'inputValue': 'Hello world',
300
+ 'expect': false
301
301
  },
302
302
  ...defaultItemss({
303
- "string 'hello'": false,
304
- "empty string": true
303
+ 'string \'hello\'': false,
304
+ 'empty string': true
305
305
  })
306
306
  ]
307
307
  },
308
308
  {
309
- "name": "Operator $=",
310
- "rule": "$=world",
311
- "items": [
309
+ 'name': 'Operator $=',
310
+ 'rule': '$=world',
311
+ 'items': [
312
312
  {
313
- "inputName": "string 'hello world'",
314
- "inputValue": "hello world",
315
- "expect": true
313
+ 'inputName': 'string \'hello world\'',
314
+ 'inputValue': 'hello world',
315
+ 'expect': true
316
316
  },
317
317
  {
318
- "inputName": "string 'hello world'",
319
- "inputValue": "Hello World",
320
- "expect": false
318
+ 'inputName': 'string \'hello world\'',
319
+ 'inputValue': 'Hello World',
320
+ 'expect': false
321
321
  },
322
322
  ...defaultItemss({
323
- "string 'hello'": false,
324
- "empty string": false
323
+ 'string \'hello\'': false,
324
+ 'empty string': false
325
325
  })
326
326
  ]
327
327
  },
328
328
  {
329
- "name": "Symbol ':end-with:'",
330
- "rule": ":end-with:world",
331
- "items": [
329
+ 'name': 'Symbol \':end-with:\'',
330
+ 'rule': ':end-with:world',
331
+ 'items': [
332
332
  {
333
- "inputName": "string 'hello world'",
334
- "inputValue": "hello world",
335
- "expect": true
333
+ 'inputName': 'string \'hello world\'',
334
+ 'inputValue': 'hello world',
335
+ 'expect': true
336
336
  },
337
337
  {
338
- "inputName": "string 'hello world'",
339
- "inputValue": "Hello World",
340
- "expect": false
338
+ 'inputName': 'string \'hello world\'',
339
+ 'inputValue': 'Hello World',
340
+ 'expect': false
341
341
  },
342
342
  ...defaultItemss({
343
- "string 'hello'": false,
344
- "empty string": false
343
+ 'string \'hello\'': false,
344
+ 'empty string': false
345
345
  })
346
346
  ]
347
347
  },
348
348
  {
349
- "name": "Symbol ':end-with-i:'",
350
- "rule": ":end-with-i:world",
351
- "items": [
349
+ 'name': 'Symbol \':end-with-i:\'',
350
+ 'rule': ':end-with-i:world',
351
+ 'items': [
352
352
  {
353
- "inputName": "string 'hello world'",
354
- "inputValue": "hello world",
355
- "expect": true
353
+ 'inputName': 'string \'hello world\'',
354
+ 'inputValue': 'hello world',
355
+ 'expect': true
356
356
  },
357
357
  {
358
- "inputName": "string 'hello world'",
359
- "inputValue": "Hello World",
360
- "expect": true
358
+ 'inputName': 'string \'hello world\'',
359
+ 'inputValue': 'Hello World',
360
+ 'expect': true
361
361
  },
362
362
  ...defaultItemss({
363
- "string 'hello'": false,
364
- "empty string": false
363
+ 'string \'hello\'': false,
364
+ 'empty string': false
365
365
  })
366
366
  ]
367
367
  },
368
368
  {
369
- "name": "Operator $!",
370
- "rule": "$!world",
371
- "items": [
369
+ 'name': 'Operator $!',
370
+ 'rule': '$!world',
371
+ 'items': [
372
372
  {
373
- "inputName": "string 'hello world'",
374
- "inputValue": "hello world",
375
- "expect": false
373
+ 'inputName': 'string \'hello world\'',
374
+ 'inputValue': 'hello world',
375
+ 'expect': false
376
376
  },
377
377
  {
378
- "inputName": "string 'hello world'",
379
- "inputValue": "Hello World",
380
- "expect": true
378
+ 'inputName': 'string \'hello world\'',
379
+ 'inputValue': 'Hello World',
380
+ 'expect': true
381
381
  },
382
382
  ...defaultItemss({
383
- "string 'hello'": true,
384
- "empty string": true
383
+ 'string \'hello\'': true,
384
+ 'empty string': true
385
385
  })
386
386
  ]
387
387
  },
388
388
  {
389
- "name": "Symbol ':not-end-with:'",
390
- "rule": ":not-end-with:world",
391
- "items": [
389
+ 'name': 'Symbol \':not-end-with:\'',
390
+ 'rule': ':not-end-with:world',
391
+ 'items': [
392
392
  {
393
- "inputName": "string 'hello world'",
394
- "inputValue": "hello world",
395
- "expect": false
393
+ 'inputName': 'string \'hello world\'',
394
+ 'inputValue': 'hello world',
395
+ 'expect': false
396
396
  },
397
397
  {
398
- "inputName": "string 'hello world'",
399
- "inputValue": "Hello World",
400
- "expect": true
398
+ 'inputName': 'string \'hello world\'',
399
+ 'inputValue': 'Hello World',
400
+ 'expect': true
401
401
  },
402
402
  ...defaultItemss({
403
- "string 'hello'": true,
404
- "empty string": true
403
+ 'string \'hello\'': true,
404
+ 'empty string': true
405
405
  })
406
406
  ]
407
407
  },
408
408
  {
409
- "name": "Symbol ':not-end-with-i:'",
410
- "rule": ":not-end-with-i:world",
411
- "items": [
409
+ 'name': 'Symbol \':not-end-with-i:\'',
410
+ 'rule': ':not-end-with-i:world',
411
+ 'items': [
412
412
  {
413
- "inputName": "string 'hello world'",
414
- "inputValue": "hello World",
415
- "expect": false
413
+ 'inputName': 'string \'hello world\'',
414
+ 'inputValue': 'hello World',
415
+ 'expect': false
416
416
  },
417
417
  {
418
- "inputName": "string 'hello world'",
419
- "inputValue": "Hello world",
420
- "expect": false
418
+ 'inputName': 'string \'hello world\'',
419
+ 'inputValue': 'Hello world',
420
+ 'expect': false
421
421
  },
422
422
  ...defaultItemss({
423
- "string 'hello'": true,
424
- "empty string": true
423
+ 'string \'hello\'': true,
424
+ 'empty string': true
425
425
  })
426
426
  ]
427
427
  },
@@ -431,360 +431,360 @@ const testItems: ITestSuite = {
431
431
  */
432
432
 
433
433
  {
434
- "name": "Operator ?=",
435
- "rule": "?=hello",
436
- "items": [
434
+ 'name': 'Operator ?=',
435
+ 'rule': '?=hello',
436
+ 'items': [
437
437
  {
438
- "inputName": "string 'hello world'",
439
- "inputValue": "hello world",
440
- "expect": true
438
+ 'inputName': 'string \'hello world\'',
439
+ 'inputValue': 'hello world',
440
+ 'expect': true
441
441
  },
442
442
  {
443
- "inputName": "string 'hello world'",
444
- "inputValue": "Hello world",
445
- "expect": false
443
+ 'inputName': 'string \'hello world\'',
444
+ 'inputValue': 'Hello world',
445
+ 'expect': false
446
446
  },
447
447
  ...defaultItemss({
448
- "string 'hello'": true,
449
- "empty string": false
448
+ 'string \'hello\'': true,
449
+ 'empty string': false
450
450
  })
451
451
  ]
452
452
  },
453
453
  {
454
- "name": "Symbol ':include:'",
455
- "rule": ":include:hello",
456
- "items": [
454
+ 'name': 'Symbol \':include:\'',
455
+ 'rule': ':include:hello',
456
+ 'items': [
457
457
  {
458
- "inputName": "string 'hello world'",
459
- "inputValue": "hello world",
460
- "expect": true
458
+ 'inputName': 'string \'hello world\'',
459
+ 'inputValue': 'hello world',
460
+ 'expect': true
461
461
  },
462
462
  {
463
- "inputName": "string 'hello world'",
464
- "inputValue": "Hello world",
465
- "expect": false
463
+ 'inputName': 'string \'hello world\'',
464
+ 'inputValue': 'Hello world',
465
+ 'expect': false
466
466
  },
467
467
  ...defaultItemss({
468
- "string 'hello'": true,
469
- "empty string": false
468
+ 'string \'hello\'': true,
469
+ 'empty string': false
470
470
  })
471
471
  ]
472
472
  },
473
473
  {
474
- "name": "Operator *=",
475
- "rule": "*=hello",
476
- "items": [
474
+ 'name': 'Operator *=',
475
+ 'rule': '*=hello',
476
+ 'items': [
477
477
  {
478
- "inputName": "string 'hello world'",
479
- "inputValue": "hello world",
480
- "expect": true
478
+ 'inputName': 'string \'hello world\'',
479
+ 'inputValue': 'hello world',
480
+ 'expect': true
481
481
  },
482
482
  {
483
- "inputName": "string 'hello world'",
484
- "inputValue": "Hello world",
485
- "expect": true
483
+ 'inputName': 'string \'hello world\'',
484
+ 'inputValue': 'Hello world',
485
+ 'expect': true
486
486
  },
487
487
  ...defaultItemss({
488
- "string 'hello'": true,
489
- "empty string": false
488
+ 'string \'hello\'': true,
489
+ 'empty string': false
490
490
  })
491
491
  ]
492
492
  },
493
493
  {
494
- "name": "Symbol ':include-i:'",
495
- "rule": ":include-i:hello",
496
- "items": [
494
+ 'name': 'Symbol \':include-i:\'',
495
+ 'rule': ':include-i:hello',
496
+ 'items': [
497
497
  {
498
- "inputName": "string 'hello world'",
499
- "inputValue": "hello world",
500
- "expect": true
498
+ 'inputName': 'string \'hello world\'',
499
+ 'inputValue': 'hello world',
500
+ 'expect': true
501
501
  },
502
502
  {
503
- "inputName": "string 'hello world'",
504
- "inputValue": "Hello world",
505
- "expect": true
503
+ 'inputName': 'string \'hello world\'',
504
+ 'inputValue': 'Hello world',
505
+ 'expect': true
506
506
  },
507
507
  ...defaultItemss({
508
- "string 'hello'": true,
509
- "empty string": false
508
+ 'string \'hello\'': true,
509
+ 'empty string': false
510
510
  })
511
511
  ]
512
512
  },
513
513
  {
514
- "name": "Operator ?!",
515
- "rule": "?!hello",
516
- "items": [
514
+ 'name': 'Operator ?!',
515
+ 'rule': '?!hello',
516
+ 'items': [
517
517
  {
518
- "inputName": "string 'hello world'",
519
- "inputValue": "hello world",
520
- "expect": false
518
+ 'inputName': 'string \'hello world\'',
519
+ 'inputValue': 'hello world',
520
+ 'expect': false
521
521
  },
522
522
  {
523
- "inputName": "string 'hello world'",
524
- "inputValue": "Hello world",
525
- "expect": true
523
+ 'inputName': 'string \'hello world\'',
524
+ 'inputValue': 'Hello world',
525
+ 'expect': true
526
526
  },
527
527
  ...defaultItemss({
528
- "string 'hello'": false,
529
- "empty string": true
528
+ 'string \'hello\'': false,
529
+ 'empty string': true
530
530
  })
531
531
  ]
532
532
  },
533
533
  {
534
- "name": "Symbol ':not-include:'",
535
- "rule": ":not-include:hello",
536
- "items": [
534
+ 'name': 'Symbol \':not-include:\'',
535
+ 'rule': ':not-include:hello',
536
+ 'items': [
537
537
  {
538
- "inputName": "string 'hello world'",
539
- "inputValue": "hello world",
540
- "expect": false
538
+ 'inputName': 'string \'hello world\'',
539
+ 'inputValue': 'hello world',
540
+ 'expect': false
541
541
  },
542
542
  {
543
- "inputName": "string 'hello world'",
544
- "inputValue": "Hello world",
545
- "expect": true
543
+ 'inputName': 'string \'hello world\'',
544
+ 'inputValue': 'Hello world',
545
+ 'expect': true
546
546
  },
547
547
  ...defaultItemss({
548
- "string 'hello'": false,
549
- "empty string": true
548
+ 'string \'hello\'': false,
549
+ 'empty string': true
550
550
  })
551
551
  ]
552
552
  },
553
553
  {
554
- "name": "Symbol ':not-include-i:'",
555
- "rule": ":not-include-i:hello",
556
- "items": [
554
+ 'name': 'Symbol \':not-include-i:\'',
555
+ 'rule': ':not-include-i:hello',
556
+ 'items': [
557
557
  {
558
- "inputName": "string 'hello world'",
559
- "inputValue": "hello world",
560
- "expect": false
558
+ 'inputName': 'string \'hello world\'',
559
+ 'inputValue': 'hello world',
560
+ 'expect': false
561
561
  },
562
562
  {
563
- "inputName": "string 'hello world'",
564
- "inputValue": "Hello world",
565
- "expect": false
563
+ 'inputName': 'string \'hello world\'',
564
+ 'inputValue': 'Hello world',
565
+ 'expect': false
566
566
  },
567
567
  ...defaultItemss({
568
- "string 'hello'": false,
569
- "empty string": true
568
+ 'string \'hello\'': false,
569
+ 'empty string': true
570
570
  })
571
571
  ]
572
572
  },
573
573
  {
574
- "name": "Operator *!",
575
- "rule": "*!hello",
576
- "items": [
574
+ 'name': 'Operator *!',
575
+ 'rule': '*!hello',
576
+ 'items': [
577
577
  {
578
- "inputName": "string 'hello world'",
579
- "inputValue": "hello world",
580
- "expect": false
578
+ 'inputName': 'string \'hello world\'',
579
+ 'inputValue': 'hello world',
580
+ 'expect': false
581
581
  },
582
582
  {
583
- "inputName": "string 'hello world'",
584
- "inputValue": "Hello world",
585
- "expect": false
583
+ 'inputName': 'string \'hello world\'',
584
+ 'inputValue': 'Hello world',
585
+ 'expect': false
586
586
  },
587
587
  ...defaultItemss({
588
- "string 'hello'": false,
589
- "empty string": true
588
+ 'string \'hello\'': false,
589
+ 'empty string': true
590
590
  })
591
591
  ]
592
592
  },
593
593
  {
594
- "name": "Operator ~=/hello/i",
595
- "rule": "~=/hello/i",
596
- "items": [
594
+ 'name': 'Operator ~=/hello/i',
595
+ 'rule': '~=/hello/i',
596
+ 'items': [
597
597
  {
598
- "inputName": "string 'hello world'",
599
- "inputValue": "hello world",
600
- "expect": true
598
+ 'inputName': 'string \'hello world\'',
599
+ 'inputValue': 'hello world',
600
+ 'expect': true
601
601
  },
602
602
  {
603
- "inputName": "string 'hello world'",
604
- "inputValue": "Hello world",
605
- "expect": true
603
+ 'inputName': 'string \'hello world\'',
604
+ 'inputValue': 'Hello world',
605
+ 'expect': true
606
606
  },
607
607
  {
608
- "inputName": "string 'hi world'",
609
- "inputValue": "hi world",
610
- "expect": false
608
+ 'inputName': 'string \'hi world\'',
609
+ 'inputValue': 'hi world',
610
+ 'expect': false
611
611
  },
612
612
  ...defaultItemss({
613
- "string 'hello'": true,
614
- "empty string": false
613
+ 'string \'hello\'': true,
614
+ 'empty string': false
615
615
  })
616
616
  ]
617
617
  },
618
618
  {
619
- "name": "Operator ~=hello",
620
- "rule": "~=hello",
621
- "items": [
619
+ 'name': 'Operator ~=hello',
620
+ 'rule': '~=hello',
621
+ 'items': [
622
622
  {
623
- "inputName": "string 'hello world'",
624
- "inputValue": "hello world",
625
- "expect": true
623
+ 'inputName': 'string \'hello world\'',
624
+ 'inputValue': 'hello world',
625
+ 'expect': true
626
626
  },
627
627
  {
628
- "inputName": "string 'hello world'",
629
- "inputValue": "Hello world",
630
- "expect": false
628
+ 'inputName': 'string \'hello world\'',
629
+ 'inputValue': 'Hello world',
630
+ 'expect': false
631
631
  },
632
632
  {
633
- "inputName": "string 'hi world'",
634
- "inputValue": "hi world",
635
- "expect": false
633
+ 'inputName': 'string \'hi world\'',
634
+ 'inputValue': 'hi world',
635
+ 'expect': false
636
636
  },
637
637
  ...defaultItemss({
638
- "string 'hello'": true,
639
- "empty string": false
638
+ 'string \'hello\'': true,
639
+ 'empty string': false
640
640
  })
641
641
  ]
642
642
  },
643
643
  {
644
- "name": "Operator ~/hello/i",
645
- "rule": "~/hello/i",
646
- "items": [
644
+ 'name': 'Operator ~/hello/i',
645
+ 'rule': '~/hello/i',
646
+ 'items': [
647
647
  {
648
- "inputName": "string 'hello world'",
649
- "inputValue": "hello world",
650
- "expect": true
648
+ 'inputName': 'string \'hello world\'',
649
+ 'inputValue': 'hello world',
650
+ 'expect': true
651
651
  },
652
652
  {
653
- "inputName": "string 'hello world'",
654
- "inputValue": "Hello world",
655
- "expect": true
653
+ 'inputName': 'string \'hello world\'',
654
+ 'inputValue': 'Hello world',
655
+ 'expect': true
656
656
  },
657
657
  {
658
- "inputName": "string 'hi world'",
659
- "inputValue": "hi world",
660
- "expect": false
658
+ 'inputName': 'string \'hi world\'',
659
+ 'inputValue': 'hi world',
660
+ 'expect': false
661
661
  },
662
662
  ...defaultItemss({
663
- "string 'hello'": true,
664
- "empty string": false
663
+ 'string \'hello\'': true,
664
+ 'empty string': false
665
665
  })
666
666
  ]
667
667
  },
668
668
  {
669
- "name": "Operator ~hello",
670
- "rule": "~hello",
671
- "items": [
669
+ 'name': 'Operator ~hello',
670
+ 'rule': '~hello',
671
+ 'items': [
672
672
  {
673
- "inputName": "string 'hello world'",
674
- "inputValue": "hello world",
675
- "expect": true
673
+ 'inputName': 'string \'hello world\'',
674
+ 'inputValue': 'hello world',
675
+ 'expect': true
676
676
  },
677
677
  {
678
- "inputName": "string 'hello world'",
679
- "inputValue": "Hello world",
680
- "expect": false
678
+ 'inputName': 'string \'hello world\'',
679
+ 'inputValue': 'Hello world',
680
+ 'expect': false
681
681
  },
682
682
  {
683
- "inputName": "string 'hi world'",
684
- "inputValue": "hi world",
685
- "expect": false
683
+ 'inputName': 'string \'hi world\'',
684
+ 'inputValue': 'hi world',
685
+ 'expect': false
686
686
  },
687
687
  ...defaultItemss({
688
- "string 'hello'": true,
689
- "empty string": false
688
+ 'string \'hello\'': true,
689
+ 'empty string': false
690
690
  })
691
691
  ]
692
692
  },
693
693
  {
694
- "name": "Operator ~!hello",
695
- "rule": "~!hello",
696
- "items": [
694
+ 'name': 'Operator ~!hello',
695
+ 'rule': '~!hello',
696
+ 'items': [
697
697
  {
698
- "inputName": "string 'hello world'",
699
- "inputValue": "hello world",
700
- "expect": false
698
+ 'inputName': 'string \'hello world\'',
699
+ 'inputValue': 'hello world',
700
+ 'expect': false
701
701
  },
702
702
  {
703
- "inputName": "string 'hello world'",
704
- "inputValue": "Hello world",
705
- "expect": true
703
+ 'inputName': 'string \'hello world\'',
704
+ 'inputValue': 'Hello world',
705
+ 'expect': true
706
706
  },
707
707
  {
708
- "inputName": "string 'hi world'",
709
- "inputValue": "hi world",
710
- "expect": true
708
+ 'inputName': 'string \'hi world\'',
709
+ 'inputValue': 'hi world',
710
+ 'expect': true
711
711
  },
712
712
  ...defaultItemss({
713
- "string 'hello'": false,
714
- "empty string": true
713
+ 'string \'hello\'': false,
714
+ 'empty string': true
715
715
  })
716
716
  ]
717
717
  },
718
718
  {
719
- "name": "Operator ~!/hello/i",
720
- "rule": "~!/hello/i",
721
- "items": [
719
+ 'name': 'Operator ~!/hello/i',
720
+ 'rule': '~!/hello/i',
721
+ 'items': [
722
722
  {
723
- "inputName": "string 'hello world'",
724
- "inputValue": "hello world",
725
- "expect": false
723
+ 'inputName': 'string \'hello world\'',
724
+ 'inputValue': 'hello world',
725
+ 'expect': false
726
726
  },
727
727
  {
728
- "inputName": "string 'hello world'",
729
- "inputValue": "Hello world",
730
- "expect": false
728
+ 'inputName': 'string \'hello world\'',
729
+ 'inputValue': 'Hello world',
730
+ 'expect': false
731
731
  },
732
732
  {
733
- "inputName": "string 'hi world'",
734
- "inputValue": "hi world",
735
- "expect": true
733
+ 'inputName': 'string \'hi world\'',
734
+ 'inputValue': 'hi world',
735
+ 'expect': true
736
736
  },
737
737
  ...defaultItemss({
738
- "string 'hello'": false,
739
- "empty string": true
738
+ 'string \'hello\'': false,
739
+ 'empty string': true
740
740
  })
741
741
  ]
742
742
  },
743
743
  {
744
- "name": "Operator ~!/hello/i with negative assert shortcut",
745
- "rule": "!~!/hello/i",
746
- "items": [
744
+ 'name': 'Operator ~!/hello/i with negative assert shortcut',
745
+ 'rule': '!~!/hello/i',
746
+ 'items': [
747
747
  {
748
- "inputName": "string 'hello world'",
749
- "inputValue": "hello world",
750
- "expect": true
748
+ 'inputName': 'string \'hello world\'',
749
+ 'inputValue': 'hello world',
750
+ 'expect': true
751
751
  },
752
752
  {
753
- "inputName": "string 'hello world'",
754
- "inputValue": "Hello world",
755
- "expect": true
753
+ 'inputName': 'string \'hello world\'',
754
+ 'inputValue': 'Hello world',
755
+ 'expect': true
756
756
  },
757
757
  {
758
- "inputName": "string 'hi world'",
759
- "inputValue": "hi world",
760
- "expect": false
758
+ 'inputName': 'string \'hi world\'',
759
+ 'inputValue': 'hi world',
760
+ 'expect': false
761
761
  },
762
762
  ...defaultItemss({
763
- "empty string": false
763
+ 'empty string': false
764
764
  }, true)
765
765
  ]
766
766
  },
767
767
  {
768
- "name": "Operator ~!/hello/i with negative assert",
769
- "rule": ["$.not", "~!/hello/i"],
770
- "items": [
768
+ 'name': 'Operator ~!/hello/i with negative assert',
769
+ 'rule': ['$.not', '~!/hello/i'],
770
+ 'items': [
771
771
  {
772
- "inputName": "string 'hello world'",
773
- "inputValue": "hello world",
774
- "expect": true
772
+ 'inputName': 'string \'hello world\'',
773
+ 'inputValue': 'hello world',
774
+ 'expect': true
775
775
  },
776
776
  {
777
- "inputName": "string 'hello world'",
778
- "inputValue": "Hello world",
779
- "expect": true
777
+ 'inputName': 'string \'hello world\'',
778
+ 'inputValue': 'Hello world',
779
+ 'expect': true
780
780
  },
781
781
  {
782
- "inputName": "string 'hi world'",
783
- "inputValue": "hi world",
784
- "expect": false
782
+ 'inputName': 'string \'hi world\'',
783
+ 'inputValue': 'hi world',
784
+ 'expect': false
785
785
  },
786
786
  ...defaultItemss({
787
- "empty string": false
787
+ 'empty string': false
788
788
  }, true)
789
789
  ]
790
790
  },