forked from atlassian/better-ajv-errors
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreenshot.js
More file actions
24 lines (18 loc) · 701 Bytes
/
Copy pathscreenshot.js
File metadata and controls
24 lines (18 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// iTerm2 Theme: https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/deep.itermcolors
const Ajv = require('ajv');
const schema = require('./src/__fixtures__/default/schema.json');
const data = require('./src/__fixtures__/default/data.json');
const betterAjvErrors = require('.').default;
// options can be passed, e.g. {allErrors: true}
// const ajv = new Ajv({ allErrors: true, async: 'es7' });
const ajv = new Ajv();
const validate = ajv.compile(schema);
const valid = validate(data);
const output = betterAjvErrors(schema, data, validate.errors, {
indent: 2,
// format: 'js',
});
if (!valid) {
// eslint-disable-next-line no-console
console.log(output);
}