@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,259 +14,259 @@
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: "Structure",
21
+ name: 'Structure',
22
22
  sections: [
23
23
 
24
24
  {
25
- "name": "Empty object",
26
- "rule": {},
27
- "items": [
25
+ 'name': 'Empty object',
26
+ 'rule': {},
27
+ 'items': [
28
28
  {
29
- inputName: "Empty object",
29
+ inputName: 'Empty object',
30
30
  inputValue: {},
31
31
  expect: true
32
32
  },
33
33
  {
34
- inputName: "Object with one property",
35
- inputValue: {"a": 123},
34
+ inputName: 'Object with one property',
35
+ inputValue: { 'a': 123 },
36
36
  expect: true
37
37
  },
38
38
  {
39
- inputName: "[int, string]",
40
- inputValue: [123, "fff"],
39
+ inputName: '[int, string]',
40
+ inputValue: [123, 'fff'],
41
41
  expect: false
42
42
  },
43
43
  ...defaultItemss({
44
- "object": true
44
+ 'object': true
45
45
  })
46
46
  ]
47
47
  },
48
48
  {
49
- "name": "1 property object",
50
- "rule": { "a": "uint32" },
51
- "items": [
49
+ 'name': '1 property object',
50
+ 'rule': { 'a': 'uint32' },
51
+ 'items': [
52
52
  {
53
- inputName: "Empty object",
53
+ inputName: 'Empty object',
54
54
  inputValue: {},
55
55
  expect: false
56
56
  },
57
57
  {
58
- inputName: "Object with one property",
59
- inputValue: {"a": 123},
58
+ inputName: 'Object with one property',
59
+ inputValue: { 'a': 123 },
60
60
  expect: true
61
61
  },
62
62
  {
63
- inputName: "[int, string]",
64
- inputValue: [123, "fff"],
63
+ inputName: '[int, string]',
64
+ inputValue: [123, 'fff'],
65
65
  expect: false
66
66
  },
67
67
  ...defaultItemss({
68
- "object": false
68
+ 'object': false
69
69
  })
70
70
  ]
71
71
  },
72
72
  {
73
- "name": "1 optional property object",
74
- "rule": { "a?": "uint32" },
75
- "items": [
73
+ 'name': '1 optional property object',
74
+ 'rule': { 'a?': 'uint32' },
75
+ 'items': [
76
76
  {
77
- inputName: "Empty object",
77
+ inputName: 'Empty object',
78
78
  inputValue: {},
79
79
  expect: true
80
80
  },
81
81
  {
82
- inputName: "Object with one property",
83
- inputValue: {"a": 123},
82
+ inputName: 'Object with one property',
83
+ inputValue: { 'a': 123 },
84
84
  expect: true
85
85
  },
86
86
  {
87
- inputName: "Object with one mismatch-type property",
88
- inputValue: {"a": "123"},
87
+ inputName: 'Object with one mismatch-type property',
88
+ inputValue: { 'a': '123' },
89
89
  expect: false
90
90
  },
91
91
  {
92
- inputName: "[int, string]",
93
- inputValue: [123, "fff"],
92
+ inputName: '[int, string]',
93
+ inputValue: [123, 'fff'],
94
94
  expect: false
95
95
  },
96
96
  ...defaultItemss({
97
- "object": true
97
+ 'object': true
98
98
  })
99
99
  ]
100
100
  },
101
101
  {
102
- "name": "Nested object",
103
- "rule": { "a?": "uint32", "b": { "c": "string" } },
104
- "items": [
102
+ 'name': 'Nested object',
103
+ 'rule': { 'a?': 'uint32', 'b': { 'c': 'string' } },
104
+ 'items': [
105
105
  {
106
- inputName: "Empty object",
106
+ inputName: 'Empty object',
107
107
  inputValue: {},
108
108
  expect: false
109
109
  },
110
110
  {
111
- inputName: "Object with one property",
112
- inputValue: {"a": 123},
111
+ inputName: 'Object with one property',
112
+ inputValue: { 'a': 123 },
113
113
  expect: false
114
114
  },
115
115
  {
116
- inputName: "Object with mismatch-typed nest property",
117
- inputValue: {"a": 123, "b": { "c": 1232131 }},
116
+ inputName: 'Object with mismatch-typed nest property',
117
+ inputValue: { 'a': 123, 'b': { 'c': 1232131 } },
118
118
  expect: false
119
119
  },
120
120
  {
121
- inputName: "Object with one mismatch-typed property",
122
- inputValue: {"a": "123", "b": { "c": "ffff"} },
121
+ inputName: 'Object with one mismatch-typed property',
122
+ inputValue: { 'a': '123', 'b': { 'c': 'ffff' } },
123
123
  expect: false
124
124
  },
125
125
  {
126
- inputName: "Object with all corrected",
127
- inputValue: {"a": 123, "b": { "c": "ffff"} },
126
+ inputName: 'Object with all corrected',
127
+ inputValue: { 'a': 123, 'b': { 'c': 'ffff' } },
128
128
  expect: true
129
129
  }
130
130
  ]
131
131
  },
132
132
  {
133
- "name": "Strict object",
134
- "rule": ["$.strict", {
135
- "a": "uint"
133
+ 'name': 'Strict object',
134
+ 'rule': ['$.strict', {
135
+ 'a': 'uint'
136
136
  }],
137
- "items": [
137
+ 'items': [
138
138
  {
139
- inputName: "Empty object",
139
+ inputName: 'Empty object',
140
140
  inputValue: {},
141
141
  expect: false
142
142
  },
143
143
  {
144
- inputName: "Object with one property",
145
- inputValue: {"a": 123},
144
+ inputName: 'Object with one property',
145
+ inputValue: { 'a': 123 },
146
146
  expect: true
147
147
  },
148
148
  {
149
- inputName: "Object with one mismatch-typed property",
150
- inputValue: {"a": "123" },
149
+ inputName: 'Object with one mismatch-typed property',
150
+ inputValue: { 'a': '123' },
151
151
  expect: false
152
152
  },
153
153
  {
154
- inputName: "Object with 2 properties",
155
- inputValue: {"a": 123, "b": { "c": "ffff"} },
154
+ inputName: 'Object with 2 properties',
155
+ inputValue: { 'a': 123, 'b': { 'c': 'ffff' } },
156
156
  expect: false
157
157
  }
158
158
  ]
159
159
  },
160
160
  {
161
- "name": "Strict object with nested properties",
162
- "rule": ["$.strict", {
163
- "a": "uint",
164
- "b": {
165
- "c": "uint"
161
+ 'name': 'Strict object with nested properties',
162
+ 'rule': ['$.strict', {
163
+ 'a': 'uint',
164
+ 'b': {
165
+ 'c': 'uint'
166
166
  }
167
167
  }],
168
- "items": [
168
+ 'items': [
169
169
  {
170
- inputName: "Object with one property",
171
- inputValue: {"a": 123},
170
+ inputName: 'Object with one property',
171
+ inputValue: { 'a': 123 },
172
172
  expect: false
173
173
  },
174
174
  {
175
- inputName: "Object with wrong type in nest",
176
- inputValue: {"a": 123, "b": { "c": "ffff"} },
175
+ inputName: 'Object with wrong type in nest',
176
+ inputValue: { 'a': 123, 'b': { 'c': 'ffff' } },
177
177
  expect: false
178
178
  },
179
179
  {
180
- inputName: "Object with all correct",
181
- inputValue: {"a": 123, "b": { "c": 123 } },
180
+ inputName: 'Object with all correct',
181
+ inputValue: { 'a': 123, 'b': { 'c': 123 } },
182
182
  expect: true
183
183
  },
184
184
  {
185
- inputName: "Object with one more in nested",
186
- inputValue: {"a": 123, "b": { "c": 123, "d": "1213131" } },
185
+ inputName: 'Object with one more in nested',
186
+ inputValue: { 'a': 123, 'b': { 'c': 123, 'd': '1213131' } },
187
187
  expect: true
188
188
  }
189
189
  ]
190
190
  },
191
191
  {
192
- "name": "Recursively-Strict object with nested properties",
193
- "rule": ["$.equal", {
194
- "a": "uint",
195
- "b": {
196
- "c": "uint"
192
+ 'name': 'Recursively-Strict object with nested properties',
193
+ 'rule': ['$.equal', {
194
+ 'a': 'uint',
195
+ 'b': {
196
+ 'c': 'uint'
197
197
  }
198
198
  }],
199
- "items": [
199
+ 'items': [
200
200
  {
201
- inputName: "Object with one property",
202
- inputValue: {"a": 123},
201
+ inputName: 'Object with one property',
202
+ inputValue: { 'a': 123 },
203
203
  expect: false
204
204
  },
205
205
  {
206
- inputName: "Object with wrong type in nest",
207
- inputValue: {"a": 123, "b": { "c": "ffff"} },
206
+ inputName: 'Object with wrong type in nest',
207
+ inputValue: { 'a': 123, 'b': { 'c': 'ffff' } },
208
208
  expect: false
209
209
  },
210
210
  {
211
- inputName: "Object with all correct",
212
- inputValue: {"a": 123, "b": { "c": 123 } },
211
+ inputName: 'Object with all correct',
212
+ inputValue: { 'a': 123, 'b': { 'c': 123 } },
213
213
  expect: true
214
214
  },
215
215
  {
216
- inputName: "Object with one more in nested",
217
- inputValue: {"a": 123, "b": { "c": 123, "d": "1213131" } },
216
+ inputName: 'Object with one more in nested',
217
+ inputValue: { 'a': 123, 'b': { 'c': 123, 'd': '1213131' } },
218
218
  expect: false
219
219
  }
220
220
  ]
221
221
  },
222
222
  {
223
- "name": "Object with from-string modifier",
224
- "rule": ["$.string", {
225
- "a": "uint",
226
- "b": {
227
- "c": "uint"
223
+ 'name': 'Object with from-string modifier',
224
+ 'rule': ['$.string', {
225
+ 'a': 'uint',
226
+ 'b': {
227
+ 'c': 'uint'
228
228
  }
229
229
  }],
230
- "items": [
230
+ 'items': [
231
231
  {
232
- inputName: "Object with all correct",
233
- inputValue: {"a": 123, "b": { "c": 123 } },
232
+ inputName: 'Object with all correct',
233
+ inputValue: { 'a': 123, 'b': { 'c': 123 } },
234
234
  expect: true
235
235
  },
236
236
  {
237
- inputName: "Object with string incorrect-value",
238
- inputValue: {"a": 123, "b": { "c": "123d" } },
237
+ inputName: 'Object with string incorrect-value',
238
+ inputValue: { 'a': 123, 'b': { 'c': '123d' } },
239
239
  expect: false
240
240
  },
241
241
  {
242
- inputName: "Object with string value",
243
- inputValue: {"a": "123312312", "b": { "c": "123" } },
242
+ inputName: 'Object with string value',
243
+ inputValue: { 'a': '123312312', 'b': { 'c': '123' } },
244
244
  expect: true
245
245
  }
246
246
  ]
247
247
  },
248
248
  {
249
- "name": "Object with from-string modifier",
250
- "rule": ["$.string", {
251
- "a": "uint",
252
- "b": {
253
- "c": "uint"
249
+ 'name': 'Object with from-string modifier',
250
+ 'rule': ['$.string', {
251
+ 'a': 'uint',
252
+ 'b': {
253
+ 'c': 'uint'
254
254
  }
255
255
  }],
256
- "items": [
256
+ 'items': [
257
257
  {
258
- inputName: "Object with all correct",
259
- inputValue: {"a": 123, "b": { "c": 123 } },
258
+ inputName: 'Object with all correct',
259
+ inputValue: { 'a': 123, 'b': { 'c': 123 } },
260
260
  expect: true
261
261
  },
262
262
  {
263
- inputName: "Object with string incorrect-value",
264
- inputValue: {"a": 123, "b": { "c": "123d" } },
263
+ inputName: 'Object with string incorrect-value',
264
+ inputValue: { 'a': 123, 'b': { 'c': '123d' } },
265
265
  expect: false
266
266
  },
267
267
  {
268
- inputName: "Object with string value",
269
- inputValue: {"a": "123312312", "b": { "c": "123" } },
268
+ inputName: 'Object with string value',
269
+ inputValue: { 'a': '123312312', 'b': { 'c': '123' } },
270
270
  expect: true
271
271
  }
272
272
  ]
@@ -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,97 +14,206 @@
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: "Modifiers",
21
+ name: 'Modifiers',
22
22
  sections: [
23
23
 
24
24
  {
25
- "name": "$.string",
26
- "rule": ["$.string", "uint32", {"a": "uint32"}],
27
- "items": [
25
+ 'name': '$.string',
26
+ 'rule': ['$.string', 'uint32', { 'a': 'uint32' }],
27
+ 'items': [
28
28
  {
29
- inputName: JSON.stringify("123"),
30
- inputValue: "123",
29
+ inputName: JSON.stringify('123'),
30
+ inputValue: '123',
31
31
  expect: true
32
32
  },
33
33
  {
34
- inputName: JSON.stringify({"a": 123}),
35
- inputValue: {"a": 123},
34
+ inputName: JSON.stringify({ 'a': 123 }),
35
+ inputValue: { 'a': 123 },
36
36
  expect: true
37
37
  },
38
38
  {
39
- inputName: JSON.stringify({"a": 123}),
40
- inputValue: {"a": 123},
39
+ inputName: JSON.stringify({ 'a': 123 }),
40
+ inputValue: { 'a': 123 },
41
41
  expect: true
42
42
  },
43
43
  ...defaultItemss({
44
- "number 1": true,
45
- "number 0": true
44
+ 'number 1': true,
45
+ 'number 0': true
46
46
  })
47
47
  ]
48
48
  },
49
49
  {
50
- "name": "$.string standalone",
51
- "rule": ["$.and", ["$.string", "uint32"], "uint32"],
52
- "items": [
50
+ 'name': '$.string standalone',
51
+ 'rule': ['$.and', ['$.string', 'uint32'], 'uint32'],
52
+ 'items': [
53
53
  {
54
- inputName: JSON.stringify("123"),
55
- inputValue: "123",
54
+ inputName: JSON.stringify('123'),
55
+ inputValue: '123',
56
56
  expect: false
57
57
  }
58
58
  ]
59
59
  },
60
60
  {
61
- "name": "$.strict standalone",
62
- "rule": ["$.tuple", ["$.strict", {
63
- "a": "string"
61
+ 'name': '$.strict standalone',
62
+ 'rule': ['$.tuple', ['$.strict', {
63
+ 'a': 'string'
64
64
  }], {
65
- "a": "string"
65
+ 'a': 'string'
66
66
  }],
67
- "items": [
67
+ 'items': [
68
68
  {
69
- inputName: JSON.stringify([{"a": "x"}, {"a": "c", "b": "x"}]),
70
- inputValue: [{"a": "x"}, {"a": "c", "b": "x"}],
69
+ inputName: JSON.stringify([{ 'a': 'x' }, { 'a': 'c', 'b': 'x' }]),
70
+ inputValue: [{ 'a': 'x' }, { 'a': 'c', 'b': 'x' }],
71
71
  expect: true
72
72
  }
73
73
  ]
74
74
  },
75
75
  {
76
- "name": "$.equal standalone",
77
- "rule": ["$.and", ["$.equal", {
78
- "a": "any"
76
+ 'name': '$.equal standalone',
77
+ 'rule': ['$.and', ['$.equal', {
78
+ 'a': 'any'
79
79
  }], {
80
- "a": {
81
- "b": "string"
80
+ 'a': {
81
+ 'b': 'string'
82
82
  }
83
83
  }],
84
- "items": [
84
+ 'items': [
85
85
  {
86
- inputName: JSON.stringify({"a": {"b": "c", "d": "ccc"}}),
87
- inputValue: {"a": {"b": "c", "d": "ccc"}},
86
+ inputName: JSON.stringify({ 'a': { 'b': 'c', 'd': 'ccc' } }),
87
+ inputValue: { 'a': { 'b': 'c', 'd': 'ccc' } },
88
88
  expect: true
89
89
  }
90
90
  ]
91
91
  },
92
92
  {
93
- "name": "$.not with string and literal 0",
94
- "rule": ["$.not", "string", 0],
95
- "items": [
93
+ 'name': '$.not with string and literal 0',
94
+ 'rule': ['$.not', 'string', 0],
95
+ 'items': [
96
96
  {
97
- inputName: "string 'abc'",
98
- inputValue: "abc",
97
+ inputName: 'string \'abc\'',
98
+ inputValue: 'abc',
99
99
  expect: false
100
100
  },
101
101
  ...defaultItemss({
102
- "string 'hello'": false,
103
- "empty string": false,
104
- "number 0": false
102
+ 'string \'hello\'': false,
103
+ 'empty string': false,
104
+ 'number 0': false
105
105
  }, true)
106
106
  ]
107
107
  },
108
+ {
109
+ 'name': '$.type ',
110
+ 'rule': {
111
+ 'a': ['$.type', 'test:a.b-c', 'int'],
112
+ 'b': '@test:a.b-c',
113
+ },
114
+ 'items': [
115
+ {
116
+ inputName: 'object {a: 213, b: 321}',
117
+ inputValue: {
118
+ 'a': 213,
119
+ 'b': 321
120
+ },
121
+ expect: true
122
+ },
123
+ {
124
+ inputName: 'object {a: 213, b: "321"}',
125
+ inputValue: {
126
+ 'a': 213,
127
+ 'b': '321'
128
+ },
129
+ expect: false
130
+ },
131
+ {
132
+ inputName: 'object {a: 213, b: "321"}',
133
+ inputValue: {
134
+ 'a': 213,
135
+ 'b': 777
136
+ },
137
+ expect: true
138
+ },
139
+ ...defaultItemss({}, false)
140
+ ]
141
+ },
142
+ {
143
+ 'name': 'Pre-defined IPv4 Address Checker',
144
+ 'rule': '@ipv4_address',
145
+ 'items': [
146
+ {
147
+ inputName: 'String: 1.1.1.1',
148
+ inputValue: '1.1.1.1',
149
+ expect: true
150
+ },
151
+ {
152
+ inputName: 'String: 255.255.255.255',
153
+ inputValue: '255.255.255.255',
154
+ expect: true
155
+ },
156
+ {
157
+ inputName: 'String: 0.0.0.0',
158
+ inputValue: '0.0.0.0',
159
+ expect: true
160
+ },
161
+ {
162
+ inputName: 'String: 2552.1.1.1',
163
+ inputValue: '2552.1.1.1',
164
+ expect: false
165
+ },
166
+ {
167
+ inputName: 'String: 256.1.1.1',
168
+ inputValue: '256.1.1.1',
169
+ expect: false
170
+ },
171
+ {
172
+ inputName: 'String: .1.1.1',
173
+ inputValue: '.1.1.1',
174
+ expect: false
175
+ },
176
+ {
177
+ inputName: 'object {a: 213, b: 321}',
178
+ inputValue: {
179
+ 'a': 213,
180
+ 'b': 321
181
+ },
182
+ expect: false
183
+ },
184
+ {
185
+ inputName: 'object {a: 213, b: "321"}',
186
+ inputValue: {
187
+ 'a': 213,
188
+ 'b': '321'
189
+ },
190
+ expect: false
191
+ },
192
+ {
193
+ inputName: 'object {a: 213, b: "321"}',
194
+ inputValue: {
195
+ 'a': 213,
196
+ 'b': 777
197
+ },
198
+ expect: false
199
+ },
200
+ ...defaultItemss({}, false)
201
+ ]
202
+ },
203
+ {
204
+ 'name': '$.type with unsupported characters in type name',
205
+ 'rule': {
206
+ 'a': ['$.type', 'test=123', 'int'],
207
+ 'b': '@test:a',
208
+ },
209
+ 'items': [
210
+ {
211
+ inputName: 'invalid format',
212
+ inputValue: '',
213
+ expect: 'throw'
214
+ }
215
+ ]
216
+ },
108
217
  ]
109
218
  };
110
219