1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
'use strict';
var validate = (function() {
var pattern0 = new RegExp('.*');
var refVal = [];
return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
'use strict';
var vErrors = null;
var errors = 0;
if ((data && typeof data === "object" && !Array.isArray(data))) {
var errs__0 = errors;
var valid1 = true;
for (var key0 in data) {
var isAdditional0 = !(false || key0 == 'keymaps' || key0 == 'search' || key0 == 'properties' || key0 == 'blacklist');
if (isAdditional0) {
valid1 = false;
validate.errors = [{
keyword: 'additionalProperties',
dataPath: (dataPath || '') + "",
schemaPath: '#/additionalProperties',
params: {
additionalProperty: '' + key0 + ''
},
message: 'should NOT have additional properties'
}];
return false;
break;
}
}
if (valid1) {
var data1 = data.keymaps;
if (data1 === undefined) {
valid1 = true;
} else {
var errs_1 = errors;
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
var errs__1 = errors;
var valid2 = true;
for (var key1 in data1) {
if (pattern0.test(key1)) {
var data2 = data1[key1];
var errs_2 = errors;
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) {
if (true) {
var errs__2 = errors;
var valid3 = true;
if (data2.type === undefined) {
valid3 = false;
validate.errors = [{
keyword: 'required',
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\']',
schemaPath: '#/properties/keymaps/patternProperties/.*/required',
params: {
missingProperty: 'type'
},
message: 'should have required property \'type\''
}];
return false;
} else {
var errs_3 = errors;
if (typeof data2.type !== "string") {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\'].type',
schemaPath: '#/properties/keymaps/patternProperties/.*/properties/type/type',
params: {
type: 'string'
},
message: 'should be string'
}];
return false;
}
var valid3 = errors === errs_3;
}
}
} else {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.keymaps[\'' + key1 + '\']',
schemaPath: '#/properties/keymaps/patternProperties/.*/type',
params: {
type: 'object'
},
message: 'should be object'
}];
return false;
}
var valid2 = errors === errs_2;
if (!valid2) break;
} else valid2 = true;
}
} else {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.keymaps',
schemaPath: '#/properties/keymaps/type',
params: {
type: 'object'
},
message: 'should be object'
}];
return false;
}
var valid1 = errors === errs_1;
}
if (valid1) {
var data1 = data.search;
if (data1 === undefined) {
valid1 = true;
} else {
var errs_1 = errors;
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
if (true) {
var errs__1 = errors;
var valid2 = true;
if (data1.default === undefined) {
valid2 = false;
validate.errors = [{
keyword: 'required',
dataPath: (dataPath || '') + '.search',
schemaPath: '#/properties/search/required',
params: {
missingProperty: 'default'
},
message: 'should have required property \'default\''
}];
return false;
} else {
var errs_2 = errors;
if (typeof data1.default !== "string") {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.search.default',
schemaPath: '#/properties/search/properties/default/type',
params: {
type: 'string'
},
message: 'should be string'
}];
return false;
}
var valid2 = errors === errs_2;
}
if (valid2) {
var data2 = data1.engines;
if (data2 === undefined) {
valid2 = true;
} else {
var errs_2 = errors;
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) {
var errs__2 = errors;
var valid3 = true;
for (var key2 in data2) {
if (pattern0.test(key2)) {
var errs_3 = errors;
if (typeof data2[key2] !== "string") {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.search.engines[\'' + key2 + '\']',
schemaPath: '#/properties/search/properties/engines/patternProperties/.*/type',
params: {
type: 'string'
},
message: 'should be string'
}];
return false;
}
var valid3 = errors === errs_3;
if (!valid3) break;
} else valid3 = true;
}
} else {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.search.engines',
schemaPath: '#/properties/search/properties/engines/type',
params: {
type: 'object'
},
message: 'should be object'
}];
return false;
}
var valid2 = errors === errs_2;
}
}
}
} else {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.search',
schemaPath: '#/properties/search/type',
params: {
type: 'object'
},
message: 'should be object'
}];
return false;
}
var valid1 = errors === errs_1;
}
if (valid1) {
var data1 = data.properties;
if (data1 === undefined) {
valid1 = true;
} else {
var errs_1 = errors;
if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
var errs__1 = errors;
var valid2 = true;
if (data1.hintchars === undefined) {
valid2 = true;
} else {
var errs_2 = errors;
if (typeof data1.hintchars !== "string") {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.properties.hintchars',
schemaPath: '#/properties/properties/properties/hintchars/type',
params: {
type: 'string'
},
message: 'should be string'
}];
return false;
}
var valid2 = errors === errs_2;
}
if (valid2) {
if (data1.smoothscroll === undefined) {
valid2 = true;
} else {
var errs_2 = errors;
if (typeof data1.smoothscroll !== "boolean") {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.properties.smoothscroll',
schemaPath: '#/properties/properties/properties/smoothscroll/type',
params: {
type: 'boolean'
},
message: 'should be boolean'
}];
return false;
}
var valid2 = errors === errs_2;
}
if (valid2) {
if (data1.complete === undefined) {
valid2 = true;
} else {
var errs_2 = errors;
if (typeof data1.complete !== "string") {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.properties.complete',
schemaPath: '#/properties/properties/properties/complete/type',
params: {
type: 'string'
},
message: 'should be string'
}];
return false;
}
var valid2 = errors === errs_2;
}
}
}
} else {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.properties',
schemaPath: '#/properties/properties/type',
params: {
type: 'object'
},
message: 'should be object'
}];
return false;
}
var valid1 = errors === errs_1;
}
if (valid1) {
var data1 = data.blacklist;
if (data1 === undefined) {
valid1 = true;
} else {
var errs_1 = errors;
if (Array.isArray(data1)) {
var errs__1 = errors;
var valid1;
for (var i1 = 0; i1 < data1.length; i1++) {
var data2 = data1[i1];
var errs_2 = errors;
var errs__2 = errors;
var valid2 = false;
var errs_3 = errors;
if (typeof data2 !== "string") {
var err = {
keyword: 'type',
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']',
schemaPath: '#/properties/blacklist/items/anyOf/0/type',
params: {
type: 'string'
},
message: 'should be string'
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
}
var valid3 = errors === errs_3;
valid2 = valid2 || valid3;
if (!valid2) {
var errs_3 = errors;
if ((data2 && typeof data2 === "object" && !Array.isArray(data2))) {
if (true) {
var errs__3 = errors;
var valid4 = true;
if (data2.url === undefined) {
valid4 = false;
var err = {
keyword: 'required',
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']',
schemaPath: '#/properties/blacklist/items/anyOf/1/required',
params: {
missingProperty: 'url'
},
message: 'should have required property \'url\''
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
} else {
var errs_4 = errors;
if (typeof data2.url !== "string") {
var err = {
keyword: 'type',
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].url',
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/url/type',
params: {
type: 'string'
},
message: 'should be string'
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
}
var valid4 = errors === errs_4;
}
if (valid4) {
var data3 = data2.keys;
if (data3 === undefined) {
valid4 = false;
var err = {
keyword: 'required',
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']',
schemaPath: '#/properties/blacklist/items/anyOf/1/required',
params: {
missingProperty: 'keys'
},
message: 'should have required property \'keys\''
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
} else {
var errs_4 = errors;
if (Array.isArray(data3)) {
var errs__4 = errors;
var valid4;
for (var i4 = 0; i4 < data3.length; i4++) {
var errs_5 = errors;
if (typeof data3[i4] !== "string") {
var err = {
keyword: 'type',
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].keys[' + i4 + ']',
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/keys/items/type',
params: {
type: 'string'
},
message: 'should be string'
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
}
var valid5 = errors === errs_5;
if (!valid5) break;
}
} else {
var err = {
keyword: 'type',
dataPath: (dataPath || '') + '.blacklist[' + i1 + '].keys',
schemaPath: '#/properties/blacklist/items/anyOf/1/properties/keys/type',
params: {
type: 'array'
},
message: 'should be array'
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
}
var valid4 = errors === errs_4;
}
}
}
} else {
var err = {
keyword: 'type',
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']',
schemaPath: '#/properties/blacklist/items/anyOf/1/type',
params: {
type: 'object'
},
message: 'should be object'
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
}
var valid3 = errors === errs_3;
valid2 = valid2 || valid3;
}
if (!valid2) {
var err = {
keyword: 'anyOf',
dataPath: (dataPath || '') + '.blacklist[' + i1 + ']',
schemaPath: '#/properties/blacklist/items/anyOf',
params: {},
message: 'should match some schema in anyOf'
};
if (vErrors === null) vErrors = [err];
else vErrors.push(err);
errors++;
validate.errors = vErrors;
return false;
} else {
errors = errs__2;
if (vErrors !== null) {
if (errs__2) vErrors.length = errs__2;
else vErrors = null;
}
}
var valid2 = errors === errs_2;
if (!valid2) break;
}
} else {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + '.blacklist',
schemaPath: '#/properties/blacklist/type',
params: {
type: 'array'
},
message: 'should be array'
}];
return false;
}
var valid1 = errors === errs_1;
}
}
}
}
}
} else {
validate.errors = [{
keyword: 'type',
dataPath: (dataPath || '') + "",
schemaPath: '#/type',
params: {
type: 'object'
},
message: 'should be object'
}];
return false;
}
validate.errors = vErrors;
return errors === 0;
};
})();
validate.schema = {
"type": "object",
"properties": {
"keymaps": {
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
},
"required": ["type"]
}
}
},
"search": {
"type": "object",
"properties": {
"default": {
"type": "string"
},
"engines": {
"type": "object",
"patternProperties": {
".*": {
"type": "string"
}
}
}
},
"required": ["default"]
},
"properties": {
"type": "object",
"properties": {
"hintchars": {
"type": "string"
},
"smoothscroll": {
"type": "boolean"
},
"complete": {
"type": "string"
}
}
},
"blacklist": {
"type": "array",
"items": {
"anyOf": [{
"type": "string"
}, {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"keys": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["url", "keys"]
}]
}
}
},
"additionalProperties": false
};
validate.errors = null;
module.exports = validate;
|