Skip to content

Commit

Permalink
Collect instances into an array in the ajv implementation before vali…
Browse files Browse the repository at this point in the history
…dating
  • Loading branch information
michaelmior committed Aug 27, 2024
1 parent 146f374 commit b240875
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion implementations/ajv/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ async function validateSchema(schemaPath, instancePath) {
ajv.addMetaSchema(draft4schema);
const validate = ajv.compile(schema);

const startTime = performance.now();
const instances = [];
for await (const instance of readJSONLines(instancePath)) {
instances.push(instance);
}
const startTime = performance.now();
for (const instance of instances) {
if (!validate(instance)) {
process.exit(1);
}
Expand Down

0 comments on commit b240875

Please sign in to comment.