massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / dist / src / validateConfig.js
1 "use strict";
2 var __importDefault = (this && this.__importDefault) || function (mod) {
3     return (mod && mod.__esModule) ? mod : { "default": mod };
4 };
5 Object.defineProperty(exports, "__esModule", { value: true });
6 exports.validateConfig = void 0;
7 const validators_1 = __importDefault(require("./generated/validators"));
8 const validateConfig = (schemaId, config) => {
9     const validate = validators_1.default[schemaId];
10     if (!validate(config) && validate.errors) {
11         // eslint-disable-next-line promise/prefer-await-to-callbacks
12         const errors = validate.errors.map((error) => {
13             return {
14                 message: error.message,
15                 params: error.params,
16                 schemaPath: error.schemaPath,
17             };
18         });
19         /* eslint-disable no-console */
20         console.log('config', config);
21         console.log('errors', errors);
22         /* eslint-enable no-console */
23         throw new Error('Invalid config.');
24     }
25 };
26 exports.validateConfig = validateConfig;
27 //# sourceMappingURL=validateConfig.js.map