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/@

19 lines (17 loc) 542 B
// @ts-ignore import { validate } from 'jsonschema'; import Notifier from '../notifier'; import { IGoatExternalProjectConfig } from '../config'; /** * Validate the config object against the provided schema */ export default function checkSchema(config: IGoatExternalProjectConfig, schema: {}) { const result = validate(config, schema); if (result.errors.length === 0) { return true; } result.errors.forEach((error) => { Notifier.error(`${error.property.replace('instance.', '')} ${error.message}`); }); return false; }