mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-11-26 01:00:27 +02:00
20 lines
587 B
JavaScript
20 lines
587 B
JavaScript
|
const path = require("path");
|
||
|
const Validator = require("jsonschema").Validator;
|
||
|
|
||
|
const schemaFile = path.resolve(__dirname, "..", ".jsonschema.json");
|
||
|
const dataFile = path.resolve(__dirname, "..", "_data", "simple-icons.json");
|
||
|
|
||
|
const schema = require(schemaFile);
|
||
|
const data = require(dataFile);
|
||
|
|
||
|
const validator = new Validator();
|
||
|
const result = validator.validate(data, schema);
|
||
|
if (result.errors.length > 0) {
|
||
|
result.errors.forEach((error) => {
|
||
|
console.error(error);
|
||
|
});
|
||
|
|
||
|
console.error(`Found ${result.errors.length} error(s) in simple-icons.json`);
|
||
|
process.exit(1);
|
||
|
}
|