.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / node_modules / table / dist / validateConfig.js
1 'use strict';
2 var equal = require('ajv/lib/compile/equal');
3 var validate = (function() {
4   var pattern0 = new RegExp('^[0-9]+$');
5   var refVal = [];
6   var refVal1 = (function() {
7     var pattern0 = new RegExp('^[0-9]+$');
8     return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
9       'use strict';
10       var vErrors = null;
11       var errors = 0;
12       if (rootData === undefined) rootData = data;
13       if ((data && typeof data === "object" && !Array.isArray(data))) {
14         var errs__0 = errors;
15         var valid1 = true;
16         for (var key0 in data) {
17           var isAdditional0 = !(false || validate.schema.properties[key0]);
18           if (isAdditional0) {
19             valid1 = false;
20             var err = {
21               keyword: 'additionalProperties',
22               dataPath: (dataPath || '') + "",
23               schemaPath: '#/additionalProperties',
24               params: {
25                 additionalProperty: '' + key0 + ''
26               },
27               message: 'should NOT have additional properties'
28             };
29             if (vErrors === null) vErrors = [err];
30             else vErrors.push(err);
31             errors++;
32           }
33         }
34         if (data.topBody !== undefined) {
35           var errs_1 = errors;
36           if (!refVal2(data.topBody, (dataPath || '') + '.topBody', data, 'topBody', rootData)) {
37             if (vErrors === null) vErrors = refVal2.errors;
38             else vErrors = vErrors.concat(refVal2.errors);
39             errors = vErrors.length;
40           }
41           var valid1 = errors === errs_1;
42         }
43         if (data.topJoin !== undefined) {
44           var errs_1 = errors;
45           if (!refVal[2](data.topJoin, (dataPath || '') + '.topJoin', data, 'topJoin', rootData)) {
46             if (vErrors === null) vErrors = refVal[2].errors;
47             else vErrors = vErrors.concat(refVal[2].errors);
48             errors = vErrors.length;
49           }
50           var valid1 = errors === errs_1;
51         }
52         if (data.topLeft !== undefined) {
53           var errs_1 = errors;
54           if (!refVal[2](data.topLeft, (dataPath || '') + '.topLeft', data, 'topLeft', rootData)) {
55             if (vErrors === null) vErrors = refVal[2].errors;
56             else vErrors = vErrors.concat(refVal[2].errors);
57             errors = vErrors.length;
58           }
59           var valid1 = errors === errs_1;
60         }
61         if (data.topRight !== undefined) {
62           var errs_1 = errors;
63           if (!refVal[2](data.topRight, (dataPath || '') + '.topRight', data, 'topRight', rootData)) {
64             if (vErrors === null) vErrors = refVal[2].errors;
65             else vErrors = vErrors.concat(refVal[2].errors);
66             errors = vErrors.length;
67           }
68           var valid1 = errors === errs_1;
69         }
70         if (data.bottomBody !== undefined) {
71           var errs_1 = errors;
72           if (!refVal[2](data.bottomBody, (dataPath || '') + '.bottomBody', data, 'bottomBody', rootData)) {
73             if (vErrors === null) vErrors = refVal[2].errors;
74             else vErrors = vErrors.concat(refVal[2].errors);
75             errors = vErrors.length;
76           }
77           var valid1 = errors === errs_1;
78         }
79         if (data.bottomJoin !== undefined) {
80           var errs_1 = errors;
81           if (!refVal[2](data.bottomJoin, (dataPath || '') + '.bottomJoin', data, 'bottomJoin', rootData)) {
82             if (vErrors === null) vErrors = refVal[2].errors;
83             else vErrors = vErrors.concat(refVal[2].errors);
84             errors = vErrors.length;
85           }
86           var valid1 = errors === errs_1;
87         }
88         if (data.bottomLeft !== undefined) {
89           var errs_1 = errors;
90           if (!refVal[2](data.bottomLeft, (dataPath || '') + '.bottomLeft', data, 'bottomLeft', rootData)) {
91             if (vErrors === null) vErrors = refVal[2].errors;
92             else vErrors = vErrors.concat(refVal[2].errors);
93             errors = vErrors.length;
94           }
95           var valid1 = errors === errs_1;
96         }
97         if (data.bottomRight !== undefined) {
98           var errs_1 = errors;
99           if (!refVal[2](data.bottomRight, (dataPath || '') + '.bottomRight', data, 'bottomRight', rootData)) {
100             if (vErrors === null) vErrors = refVal[2].errors;
101             else vErrors = vErrors.concat(refVal[2].errors);
102             errors = vErrors.length;
103           }
104           var valid1 = errors === errs_1;
105         }
106         if (data.bodyLeft !== undefined) {
107           var errs_1 = errors;
108           if (!refVal[2](data.bodyLeft, (dataPath || '') + '.bodyLeft', data, 'bodyLeft', rootData)) {
109             if (vErrors === null) vErrors = refVal[2].errors;
110             else vErrors = vErrors.concat(refVal[2].errors);
111             errors = vErrors.length;
112           }
113           var valid1 = errors === errs_1;
114         }
115         if (data.bodyRight !== undefined) {
116           var errs_1 = errors;
117           if (!refVal[2](data.bodyRight, (dataPath || '') + '.bodyRight', data, 'bodyRight', rootData)) {
118             if (vErrors === null) vErrors = refVal[2].errors;
119             else vErrors = vErrors.concat(refVal[2].errors);
120             errors = vErrors.length;
121           }
122           var valid1 = errors === errs_1;
123         }
124         if (data.bodyJoin !== undefined) {
125           var errs_1 = errors;
126           if (!refVal[2](data.bodyJoin, (dataPath || '') + '.bodyJoin', data, 'bodyJoin', rootData)) {
127             if (vErrors === null) vErrors = refVal[2].errors;
128             else vErrors = vErrors.concat(refVal[2].errors);
129             errors = vErrors.length;
130           }
131           var valid1 = errors === errs_1;
132         }
133         if (data.joinBody !== undefined) {
134           var errs_1 = errors;
135           if (!refVal[2](data.joinBody, (dataPath || '') + '.joinBody', data, 'joinBody', rootData)) {
136             if (vErrors === null) vErrors = refVal[2].errors;
137             else vErrors = vErrors.concat(refVal[2].errors);
138             errors = vErrors.length;
139           }
140           var valid1 = errors === errs_1;
141         }
142         if (data.joinLeft !== undefined) {
143           var errs_1 = errors;
144           if (!refVal[2](data.joinLeft, (dataPath || '') + '.joinLeft', data, 'joinLeft', rootData)) {
145             if (vErrors === null) vErrors = refVal[2].errors;
146             else vErrors = vErrors.concat(refVal[2].errors);
147             errors = vErrors.length;
148           }
149           var valid1 = errors === errs_1;
150         }
151         if (data.joinRight !== undefined) {
152           var errs_1 = errors;
153           if (!refVal[2](data.joinRight, (dataPath || '') + '.joinRight', data, 'joinRight', rootData)) {
154             if (vErrors === null) vErrors = refVal[2].errors;
155             else vErrors = vErrors.concat(refVal[2].errors);
156             errors = vErrors.length;
157           }
158           var valid1 = errors === errs_1;
159         }
160         if (data.joinJoin !== undefined) {
161           var errs_1 = errors;
162           if (!refVal[2](data.joinJoin, (dataPath || '') + '.joinJoin', data, 'joinJoin', rootData)) {
163             if (vErrors === null) vErrors = refVal[2].errors;
164             else vErrors = vErrors.concat(refVal[2].errors);
165             errors = vErrors.length;
166           }
167           var valid1 = errors === errs_1;
168         }
169       } else {
170         var err = {
171           keyword: 'type',
172           dataPath: (dataPath || '') + "",
173           schemaPath: '#/type',
174           params: {
175             type: 'object'
176           },
177           message: 'should be object'
178         };
179         if (vErrors === null) vErrors = [err];
180         else vErrors.push(err);
181         errors++;
182       }
183       validate.errors = vErrors;
184       return errors === 0;
185     };
186   })();
187   refVal1.schema = {
188     "type": "object",
189     "properties": {
190       "topBody": {
191         "$ref": "#/definitions/border"
192       },
193       "topJoin": {
194         "$ref": "#/definitions/border"
195       },
196       "topLeft": {
197         "$ref": "#/definitions/border"
198       },
199       "topRight": {
200         "$ref": "#/definitions/border"
201       },
202       "bottomBody": {
203         "$ref": "#/definitions/border"
204       },
205       "bottomJoin": {
206         "$ref": "#/definitions/border"
207       },
208       "bottomLeft": {
209         "$ref": "#/definitions/border"
210       },
211       "bottomRight": {
212         "$ref": "#/definitions/border"
213       },
214       "bodyLeft": {
215         "$ref": "#/definitions/border"
216       },
217       "bodyRight": {
218         "$ref": "#/definitions/border"
219       },
220       "bodyJoin": {
221         "$ref": "#/definitions/border"
222       },
223       "joinBody": {
224         "$ref": "#/definitions/border"
225       },
226       "joinLeft": {
227         "$ref": "#/definitions/border"
228       },
229       "joinRight": {
230         "$ref": "#/definitions/border"
231       },
232       "joinJoin": {
233         "$ref": "#/definitions/border"
234       }
235     },
236     "additionalProperties": false
237   };
238   refVal1.errors = null;
239   refVal[1] = refVal1;
240   var refVal2 = (function() {
241     var pattern0 = new RegExp('^[0-9]+$');
242     return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
243       'use strict';
244       var vErrors = null;
245       var errors = 0;
246       if (typeof data !== "string") {
247         var err = {
248           keyword: 'type',
249           dataPath: (dataPath || '') + "",
250           schemaPath: '#/type',
251           params: {
252             type: 'string'
253           },
254           message: 'should be string'
255         };
256         if (vErrors === null) vErrors = [err];
257         else vErrors.push(err);
258         errors++;
259       }
260       validate.errors = vErrors;
261       return errors === 0;
262     };
263   })();
264   refVal2.schema = {
265     "type": "string"
266   };
267   refVal2.errors = null;
268   refVal[2] = refVal2;
269   var refVal3 = (function() {
270     var pattern0 = new RegExp('^[0-9]+$');
271     return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
272       'use strict';
273       var vErrors = null;
274       var errors = 0;
275       if (rootData === undefined) rootData = data;
276       if ((data && typeof data === "object" && !Array.isArray(data))) {
277         var errs__0 = errors;
278         var valid1 = true;
279         for (var key0 in data) {
280           var isAdditional0 = !(false || pattern0.test(key0));
281           if (isAdditional0) {
282             valid1 = false;
283             var err = {
284               keyword: 'additionalProperties',
285               dataPath: (dataPath || '') + "",
286               schemaPath: '#/additionalProperties',
287               params: {
288                 additionalProperty: '' + key0 + ''
289               },
290               message: 'should NOT have additional properties'
291             };
292             if (vErrors === null) vErrors = [err];
293             else vErrors.push(err);
294             errors++;
295           }
296         }
297         for (var key0 in data) {
298           if (pattern0.test(key0)) {
299             var errs_1 = errors;
300             if (!refVal4(data[key0], (dataPath || '') + '[\'' + key0 + '\']', data, key0, rootData)) {
301               if (vErrors === null) vErrors = refVal4.errors;
302               else vErrors = vErrors.concat(refVal4.errors);
303               errors = vErrors.length;
304             }
305             var valid1 = errors === errs_1;
306           }
307         }
308       } else {
309         var err = {
310           keyword: 'type',
311           dataPath: (dataPath || '') + "",
312           schemaPath: '#/type',
313           params: {
314             type: 'object'
315           },
316           message: 'should be object'
317         };
318         if (vErrors === null) vErrors = [err];
319         else vErrors.push(err);
320         errors++;
321       }
322       validate.errors = vErrors;
323       return errors === 0;
324     };
325   })();
326   refVal3.schema = {
327     "type": "object",
328     "patternProperties": {
329       "^[0-9]+$": {
330         "$ref": "#/definitions/column"
331       }
332     },
333     "additionalProperties": false
334   };
335   refVal3.errors = null;
336   refVal[3] = refVal3;
337   var refVal4 = (function() {
338     var pattern0 = new RegExp('^[0-9]+$');
339     return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
340       'use strict';
341       var vErrors = null;
342       var errors = 0;
343       if ((data && typeof data === "object" && !Array.isArray(data))) {
344         var errs__0 = errors;
345         var valid1 = true;
346         for (var key0 in data) {
347           var isAdditional0 = !(false || validate.schema.properties[key0]);
348           if (isAdditional0) {
349             valid1 = false;
350             var err = {
351               keyword: 'additionalProperties',
352               dataPath: (dataPath || '') + "",
353               schemaPath: '#/additionalProperties',
354               params: {
355                 additionalProperty: '' + key0 + ''
356               },
357               message: 'should NOT have additional properties'
358             };
359             if (vErrors === null) vErrors = [err];
360             else vErrors.push(err);
361             errors++;
362           }
363         }
364         var data1 = data.alignment;
365         if (data1 !== undefined) {
366           var errs_1 = errors;
367           if (typeof data1 !== "string") {
368             var err = {
369               keyword: 'type',
370               dataPath: (dataPath || '') + '.alignment',
371               schemaPath: '#/properties/alignment/type',
372               params: {
373                 type: 'string'
374               },
375               message: 'should be string'
376             };
377             if (vErrors === null) vErrors = [err];
378             else vErrors.push(err);
379             errors++;
380           }
381           var schema1 = validate.schema.properties.alignment.enum;
382           var valid1;
383           valid1 = false;
384           for (var i1 = 0; i1 < schema1.length; i1++)
385             if (equal(data1, schema1[i1])) {
386               valid1 = true;
387               break;
388             }
389           if (!valid1) {
390             var err = {
391               keyword: 'enum',
392               dataPath: (dataPath || '') + '.alignment',
393               schemaPath: '#/properties/alignment/enum',
394               params: {
395                 allowedValues: schema1
396               },
397               message: 'should be equal to one of the allowed values'
398             };
399             if (vErrors === null) vErrors = [err];
400             else vErrors.push(err);
401             errors++;
402           }
403           var valid1 = errors === errs_1;
404         }
405         if (data.width !== undefined) {
406           var errs_1 = errors;
407           if (typeof data.width !== "number") {
408             var err = {
409               keyword: 'type',
410               dataPath: (dataPath || '') + '.width',
411               schemaPath: '#/properties/width/type',
412               params: {
413                 type: 'number'
414               },
415               message: 'should be number'
416             };
417             if (vErrors === null) vErrors = [err];
418             else vErrors.push(err);
419             errors++;
420           }
421           var valid1 = errors === errs_1;
422         }
423         if (data.wrapWord !== undefined) {
424           var errs_1 = errors;
425           if (typeof data.wrapWord !== "boolean") {
426             var err = {
427               keyword: 'type',
428               dataPath: (dataPath || '') + '.wrapWord',
429               schemaPath: '#/properties/wrapWord/type',
430               params: {
431                 type: 'boolean'
432               },
433               message: 'should be boolean'
434             };
435             if (vErrors === null) vErrors = [err];
436             else vErrors.push(err);
437             errors++;
438           }
439           var valid1 = errors === errs_1;
440         }
441         if (data.truncate !== undefined) {
442           var errs_1 = errors;
443           if (typeof data.truncate !== "number") {
444             var err = {
445               keyword: 'type',
446               dataPath: (dataPath || '') + '.truncate',
447               schemaPath: '#/properties/truncate/type',
448               params: {
449                 type: 'number'
450               },
451               message: 'should be number'
452             };
453             if (vErrors === null) vErrors = [err];
454             else vErrors.push(err);
455             errors++;
456           }
457           var valid1 = errors === errs_1;
458         }
459         if (data.paddingLeft !== undefined) {
460           var errs_1 = errors;
461           if (typeof data.paddingLeft !== "number") {
462             var err = {
463               keyword: 'type',
464               dataPath: (dataPath || '') + '.paddingLeft',
465               schemaPath: '#/properties/paddingLeft/type',
466               params: {
467                 type: 'number'
468               },
469               message: 'should be number'
470             };
471             if (vErrors === null) vErrors = [err];
472             else vErrors.push(err);
473             errors++;
474           }
475           var valid1 = errors === errs_1;
476         }
477         if (data.paddingRight !== undefined) {
478           var errs_1 = errors;
479           if (typeof data.paddingRight !== "number") {
480             var err = {
481               keyword: 'type',
482               dataPath: (dataPath || '') + '.paddingRight',
483               schemaPath: '#/properties/paddingRight/type',
484               params: {
485                 type: 'number'
486               },
487               message: 'should be number'
488             };
489             if (vErrors === null) vErrors = [err];
490             else vErrors.push(err);
491             errors++;
492           }
493           var valid1 = errors === errs_1;
494         }
495       } else {
496         var err = {
497           keyword: 'type',
498           dataPath: (dataPath || '') + "",
499           schemaPath: '#/type',
500           params: {
501             type: 'object'
502           },
503           message: 'should be object'
504         };
505         if (vErrors === null) vErrors = [err];
506         else vErrors.push(err);
507         errors++;
508       }
509       validate.errors = vErrors;
510       return errors === 0;
511     };
512   })();
513   refVal4.schema = {
514     "type": "object",
515     "properties": {
516       "alignment": {
517         "type": "string",
518         "enum": ["left", "right", "center"]
519       },
520       "width": {
521         "type": "number"
522       },
523       "wrapWord": {
524         "type": "boolean"
525       },
526       "truncate": {
527         "type": "number"
528       },
529       "paddingLeft": {
530         "type": "number"
531       },
532       "paddingRight": {
533         "type": "number"
534       }
535     },
536     "additionalProperties": false
537   };
538   refVal4.errors = null;
539   refVal[4] = refVal4;
540   return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
541     'use strict'; /*# sourceURL=config.json */
542     var vErrors = null;
543     var errors = 0;
544     if (rootData === undefined) rootData = data;
545     if ((data && typeof data === "object" && !Array.isArray(data))) {
546       var errs__0 = errors;
547       var valid1 = true;
548       for (var key0 in data) {
549         var isAdditional0 = !(false || key0 == 'border' || key0 == 'columns' || key0 == 'columnDefault' || key0 == 'drawHorizontalLine');
550         if (isAdditional0) {
551           valid1 = false;
552           var err = {
553             keyword: 'additionalProperties',
554             dataPath: (dataPath || '') + "",
555             schemaPath: '#/additionalProperties',
556             params: {
557               additionalProperty: '' + key0 + ''
558             },
559             message: 'should NOT have additional properties'
560           };
561           if (vErrors === null) vErrors = [err];
562           else vErrors.push(err);
563           errors++;
564         }
565       }
566       if (data.border !== undefined) {
567         var errs_1 = errors;
568         if (!refVal1(data.border, (dataPath || '') + '.border', data, 'border', rootData)) {
569           if (vErrors === null) vErrors = refVal1.errors;
570           else vErrors = vErrors.concat(refVal1.errors);
571           errors = vErrors.length;
572         }
573         var valid1 = errors === errs_1;
574       }
575       if (data.columns !== undefined) {
576         var errs_1 = errors;
577         if (!refVal3(data.columns, (dataPath || '') + '.columns', data, 'columns', rootData)) {
578           if (vErrors === null) vErrors = refVal3.errors;
579           else vErrors = vErrors.concat(refVal3.errors);
580           errors = vErrors.length;
581         }
582         var valid1 = errors === errs_1;
583       }
584       if (data.columnDefault !== undefined) {
585         var errs_1 = errors;
586         if (!refVal[4](data.columnDefault, (dataPath || '') + '.columnDefault', data, 'columnDefault', rootData)) {
587           if (vErrors === null) vErrors = refVal[4].errors;
588           else vErrors = vErrors.concat(refVal[4].errors);
589           errors = vErrors.length;
590         }
591         var valid1 = errors === errs_1;
592       }
593       if (data.drawHorizontalLine !== undefined) {
594         var errs_1 = errors;
595         var errs__1 = errors;
596         var valid1;
597         valid1 = typeof data.drawHorizontalLine == "function";
598         if (!valid1) {
599           if (errs__1 == errors) {
600             var err = {
601               keyword: 'typeof',
602               dataPath: (dataPath || '') + '.drawHorizontalLine',
603               schemaPath: '#/properties/drawHorizontalLine/typeof',
604               params: {
605                 keyword: 'typeof'
606               },
607               message: 'should pass "typeof" keyword validation'
608             };
609             if (vErrors === null) vErrors = [err];
610             else vErrors.push(err);
611             errors++;
612           } else {
613             for (var i1 = errs__1; i1 < errors; i1++) {
614               var ruleErr1 = vErrors[i1];
615               if (ruleErr1.dataPath === undefined) ruleErr1.dataPath = (dataPath || '') + '.drawHorizontalLine';
616               if (ruleErr1.schemaPath === undefined) {
617                 ruleErr1.schemaPath = "#/properties/drawHorizontalLine/typeof";
618               }
619             }
620           }
621         }
622         var valid1 = errors === errs_1;
623       }
624     } else {
625       var err = {
626         keyword: 'type',
627         dataPath: (dataPath || '') + "",
628         schemaPath: '#/type',
629         params: {
630           type: 'object'
631         },
632         message: 'should be object'
633       };
634       if (vErrors === null) vErrors = [err];
635       else vErrors.push(err);
636       errors++;
637     }
638     validate.errors = vErrors;
639     return errors === 0;
640   };
641 })();
642 validate.schema = {
643   "$id": "config.json",
644   "$schema": "http://json-schema.org/draft-06/schema#",
645   "type": "object",
646   "properties": {
647     "border": {
648       "$ref": "#/definitions/borders"
649     },
650     "columns": {
651       "$ref": "#/definitions/columns"
652     },
653     "columnDefault": {
654       "$ref": "#/definitions/column"
655     },
656     "drawHorizontalLine": {
657       "typeof": "function"
658     }
659   },
660   "additionalProperties": false,
661   "definitions": {
662     "columns": {
663       "type": "object",
664       "patternProperties": {
665         "^[0-9]+$": {
666           "$ref": "#/definitions/column"
667         }
668       },
669       "additionalProperties": false
670     },
671     "column": {
672       "type": "object",
673       "properties": {
674         "alignment": {
675           "type": "string",
676           "enum": ["left", "right", "center"]
677         },
678         "width": {
679           "type": "number"
680         },
681         "wrapWord": {
682           "type": "boolean"
683         },
684         "truncate": {
685           "type": "number"
686         },
687         "paddingLeft": {
688           "type": "number"
689         },
690         "paddingRight": {
691           "type": "number"
692         }
693       },
694       "additionalProperties": false
695     },
696     "borders": {
697       "type": "object",
698       "properties": {
699         "topBody": {
700           "$ref": "#/definitions/border"
701         },
702         "topJoin": {
703           "$ref": "#/definitions/border"
704         },
705         "topLeft": {
706           "$ref": "#/definitions/border"
707         },
708         "topRight": {
709           "$ref": "#/definitions/border"
710         },
711         "bottomBody": {
712           "$ref": "#/definitions/border"
713         },
714         "bottomJoin": {
715           "$ref": "#/definitions/border"
716         },
717         "bottomLeft": {
718           "$ref": "#/definitions/border"
719         },
720         "bottomRight": {
721           "$ref": "#/definitions/border"
722         },
723         "bodyLeft": {
724           "$ref": "#/definitions/border"
725         },
726         "bodyRight": {
727           "$ref": "#/definitions/border"
728         },
729         "bodyJoin": {
730           "$ref": "#/definitions/border"
731         },
732         "joinBody": {
733           "$ref": "#/definitions/border"
734         },
735         "joinLeft": {
736           "$ref": "#/definitions/border"
737         },
738         "joinRight": {
739           "$ref": "#/definitions/border"
740         },
741         "joinJoin": {
742           "$ref": "#/definitions/border"
743         }
744       },
745       "additionalProperties": false
746     },
747     "border": {
748       "type": "string"
749     }
750   }
751 };
752 validate.errors = null;
753 module.exports = validate;