UNPKG

@the-goat/core

Version:

![npm version](https://badgen.net/npm/v/@the-goat/goat?icon=npm) ![npm downloads](https://badgen.net/npm/dt/@the-goat/goat?icon=npm) ![npm weekly downloads](https://badgen.net/npm/dw/@the-goat/goat?icon=npm) ![npm licence](https://badgen.net/npm/license/@

23 lines 791 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); // @ts-ignore var jsonschema_1 = require("jsonschema"); var notifier_1 = __importDefault(require("../notifier")); /** * Validate the config object against the provided schema */ function checkSchema(config, schema) { var result = jsonschema_1.validate(config, schema); if (result.errors.length === 0) { return true; } result.errors.forEach(function (error) { notifier_1.default.error(error.property.replace('instance.', '') + " " + error.message); }); return false; } exports.default = checkSchema; //# sourceMappingURL=schema.js.map