Skip to content

Commit 3a5136b

Browse files
committed
Remove redundant type properties from params
1 parent 92c06e3 commit 3a5136b

File tree

6 files changed

+19
-61
lines changed

6 files changed

+19
-61
lines changed

test/schema.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,22 +220,28 @@
220220
},
221221
"var": {
222222
"type": "object",
223-
"additionalProperties": false,
224-
"required": [
225-
"value"
226-
],
227-
"properties": {
228-
"name": {
229-
"type": "string"
230-
},
231-
"type": {
232-
"const": "datetime"
233-
},
234-
"value": {}
235-
},
236223
"oneOf": [
237224
{
225+
"additionalProperties": false,
226+
"required": [
227+
"value"
228+
],
229+
"properties": {
230+
"name": {
231+
"type": "string"
232+
},
233+
"value": {}
234+
}
235+
},
236+
{
237+
"required": [
238+
"type",
239+
"value"
240+
],
238241
"properties": {
242+
"name": {
243+
"type": "string"
244+
},
239245
"type": {
240246
"const": "datetime"
241247
},

test/tests/core.json

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"src": "hello {$place}",
3737
"params": [
3838
{
39-
"type": "string",
4039
"name": "place",
4140
"value": "world"
4241
}
@@ -47,7 +46,6 @@
4746
"src": "hello {$place-.}",
4847
"params": [
4948
{
50-
"type": "string",
5149
"name": "place-.",
5250
"value": "world"
5351
}
@@ -67,12 +65,10 @@
6765
"src": "{$one} and {$two}",
6866
"params": [
6967
{
70-
"type": "number",
7168
"name": "one",
7269
"value": 1.3
7370
},
7471
{
75-
"type": "number",
7672
"name": "two",
7773
"value": 4.2
7874
}
@@ -84,12 +80,10 @@
8480
"locale": "fr",
8581
"params": [
8682
{
87-
"type": "number",
8883
"name": "one",
8984
"value": 1.3
9085
},
9186
{
92-
"type": "number",
9387
"name": "two",
9488
"value": 4.2
9589
}
@@ -108,7 +102,6 @@
108102
"src": ".local $foo = {|bar|} {{bar {$foo}}}",
109103
"params": [
110104
{
111-
"type": "string",
112105
"name": "foo",
113106
"value": "foo"
114107
}
@@ -119,7 +112,6 @@
119112
"src": ".local $foo = {$bar} {{bar {$foo}}}",
120113
"params": [
121114
{
122-
"type": "string",
123115
"name": "bar",
124116
"value": "foo"
125117
}
@@ -130,7 +122,6 @@
130122
"src": ".local $foo = {$baz} .local $bar = {$foo} {{bar {$bar}}}",
131123
"params": [
132124
{
133-
"type": "string",
134125
"name": "baz",
135126
"value": "foo"
136127
}
@@ -141,7 +132,6 @@
141132
"src": ".input {$foo} {{bar {$foo}}}",
142133
"params": [
143134
{
144-
"type": "string",
145135
"name": "foo",
146136
"value": "foo"
147137
}
@@ -152,7 +142,6 @@
152142
"src": ".input {$foo} .local $bar = {$foo} {{bar {$bar}}}",
153143
"params": [
154144
{
155-
"type": "string",
156145
"name": "foo",
157146
"value": "foo"
158147
}
@@ -163,7 +152,6 @@
163152
"src": ".local $foo = {$baz} .local $bar = {$foo} {{bar {$bar}}}",
164153
"params": [
165154
{
166-
"type": "string",
167155
"name": "baz",
168156
"value": "foo"
169157
}
@@ -268,7 +256,6 @@
268256
"src": "{#tag a:foo=|foo| b:bar=$bar}",
269257
"params": [
270258
{
271-
"type": "string",
272259
"name": "bar",
273260
"value": "b a r"
274261
}

test/tests/functions/datetime.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"exp": "{$x}",
2222
"params": [
2323
{
24-
"type": "boolean",
2524
"name": "x",
2625
"value": true
2726
}

test/tests/functions/integer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"src": ".match {$foo :integer} one {{one}} * {{other}}",
2222
"params": [
2323
{
24-
"type": "number",
2524
"name": "foo",
2625
"value": 1.2
2726
}

test/tests/functions/number.json

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
"src": "hello {4.2 :number minimumFractionDigits=$foo}",
9393
"params": [
9494
{
95-
"type": "number",
9695
"name": "foo",
9796
"value": 2
9897
}
@@ -103,7 +102,6 @@
103102
"src": "hello {|4.2| :number minimumFractionDigits=$foo}",
104103
"params": [
105104
{
106-
"type": "string",
107105
"name": "foo",
108106
"value": "2"
109107
}
@@ -114,7 +112,6 @@
114112
"src": ".local $foo = {$bar :number} {{bar {$foo}}}",
115113
"params": [
116114
{
117-
"type": "number",
118115
"name": "bar",
119116
"value": 4.2
120117
}
@@ -125,7 +122,6 @@
125122
"src": ".local $foo = {$bar :number minimumFractionDigits=2} {{bar {$foo}}}",
126123
"params": [
127124
{
128-
"type": "number",
129125
"name": "bar",
130126
"value": 4.2
131127
}
@@ -136,7 +132,6 @@
136132
"src": ".local $foo = {$bar :number minimumFractionDigits=foo} {{bar {$foo}}}",
137133
"params": [
138134
{
139-
"type": "number",
140135
"name": "bar",
141136
"value": 4.2
142137
}
@@ -152,7 +147,6 @@
152147
"src": ".local $foo = {$bar :number} {{bar {$foo}}}",
153148
"params": [
154149
{
155-
"type": "string",
156150
"name": "bar",
157151
"value": "foo"
158152
}
@@ -168,7 +162,6 @@
168162
"src": ".input {$foo :number} {{bar {$foo}}}",
169163
"params": [
170164
{
171-
"type": "number",
172165
"name": "foo",
173166
"value": 4.2
174167
}
@@ -179,7 +172,6 @@
179172
"src": ".input {$foo :number minimumFractionDigits=2} {{bar {$foo}}}",
180173
"params": [
181174
{
182-
"type": "number",
183175
"name": "foo",
184176
"value": 4.2
185177
}
@@ -190,7 +182,6 @@
190182
"src": ".input {$foo :number minimumFractionDigits=foo} {{bar {$foo}}}",
191183
"params": [
192184
{
193-
"type": "number",
194185
"name": "foo",
195186
"value": 4.2
196187
}
@@ -206,7 +197,6 @@
206197
"src": ".input {$foo :number} {{bar {$foo}}}",
207198
"params": [
208199
{
209-
"type": "string",
210200
"name": "foo",
211201
"value": "foo"
212202
}
@@ -222,7 +212,6 @@
222212
"src": ".match {$foo :number} one {{one}} * {{other}}",
223213
"params": [
224214
{
225-
"type": "number",
226215
"name": "foo",
227216
"value": 1
228217
}
@@ -233,7 +222,6 @@
233222
"src": ".match {$foo :number} 1 {{=1}} one {{one}} * {{other}}",
234223
"params": [
235224
{
236-
"type": "number",
237225
"name": "foo",
238226
"value": 1
239227
}
@@ -244,7 +232,6 @@
244232
"src": ".match {$foo :number} one {{one}} 1 {{=1}} * {{other}}",
245233
"params": [
246234
{
247-
"type": "number",
248235
"name": "foo",
249236
"value": 1
250237
}
@@ -255,12 +242,10 @@
255242
"src": ".match {$foo :number} {$bar :number} one one {{one one}} one * {{one other}} * * {{other}}",
256243
"params": [
257244
{
258-
"type": "number",
259245
"name": "foo",
260246
"value": 1
261247
},
262248
{
263-
"type": "number",
264249
"name": "bar",
265250
"value": 1
266251
}
@@ -271,12 +256,10 @@
271256
"src": ".match {$foo :number} {$bar :number} one one {{one one}} one * {{one other}} * * {{other}}",
272257
"params": [
273258
{
274-
"type": "number",
275259
"name": "foo",
276260
"value": 1
277261
},
278262
{
279-
"type": "number",
280263
"name": "bar",
281264
"value": 2
282265
}
@@ -287,12 +270,10 @@
287270
"src": ".match {$foo :number} {$bar :number} one one {{one one}} one * {{one other}} * * {{other}}",
288271
"params": [
289272
{
290-
"type": "number",
291273
"name": "foo",
292274
"value": 2
293275
},
294276
{
295-
"type": "number",
296277
"name": "bar",
297278
"value": 2
298279
}
@@ -303,7 +284,6 @@
303284
"src": ".input {$foo :number} .match {$foo} one {{one}} * {{other}}",
304285
"params": [
305286
{
306-
"type": "number",
307287
"name": "foo",
308288
"value": 1
309289
}
@@ -314,7 +294,6 @@
314294
"src": ".local $foo = {$bar :number} .match {$foo} one {{one}} * {{other}}",
315295
"params": [
316296
{
317-
"type": "number",
318297
"name": "bar",
319298
"value": 1
320299
}
@@ -325,7 +304,6 @@
325304
"src": ".input {$foo :number} .local $bar = {$foo} .match {$bar} one {{one}} * {{other}}",
326305
"params": [
327306
{
328-
"type": "number",
329307
"name": "foo",
330308
"value": 1
331309
}
@@ -336,7 +314,6 @@
336314
"src": ".input {$bar :number} .match {$bar} one {{one}} * {{other}}",
337315
"params": [
338316
{
339-
"type": "number",
340317
"name": "bar",
341318
"value": 2
342319
}
@@ -347,7 +324,6 @@
347324
"src": ".input {$bar} .match {$bar :number} one {{one}} * {{other}}",
348325
"params": [
349326
{
350-
"type": "number",
351327
"name": "bar",
352328
"value": 1
353329
}
@@ -358,7 +334,6 @@
358334
"src": ".input {$bar} .match {$bar :number} one {{one}} * {{other}}",
359335
"params": [
360336
{
361-
"type": "number",
362337
"name": "bar",
363338
"value": 2
364339
}
@@ -369,7 +344,6 @@
369344
"src": ".input {$bar} .match {$bar :number} one {{one}} * {{other}}",
370345
"params": [
371346
{
372-
"type": "number",
373347
"name": "bar",
374348
"value": 1
375349
}
@@ -380,7 +354,6 @@
380354
"src": ".input {$bar} .match {$bar :number} one {{one}} * {{other}}",
381355
"params": [
382356
{
383-
"type": "number",
384357
"name": "bar",
385358
"value": 2
386359
}
@@ -391,7 +364,6 @@
391364
"src": ".input {$none} .match {$foo :number} one {{one}} * {{{$none}}}",
392365
"params": [
393366
{
394-
"type": "number",
395367
"name": "foo",
396368
"value": 1
397369
}
@@ -402,7 +374,6 @@
402374
"src": ".local $bar = {$none} .match {$foo :number} one {{one}} * {{{$bar}}}",
403375
"params": [
404376
{
405-
"type": "number",
406377
"name": "foo",
407378
"value": 1
408379
}
@@ -413,7 +384,6 @@
413384
"src": ".local $bar = {$none} .match {$foo :number} one {{one}} * {{{$bar}}}",
414385
"params": [
415386
{
416-
"type": "number",
417387
"name": "foo",
418388
"value": 2
419389
}

0 commit comments

Comments
 (0)