mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-08-28 04:45:42 +00:00
Docs: Update benchmark for google/gemini-3.7-flash EFF:high
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
export async function validateJSON(data, schema) {
|
||||
const Ajv = (await import('https://esm.sh/ajv@8')).default;
|
||||
const ajv = new Ajv({ allErrors: true, strict: false });
|
||||
const validate = ajv.compile(schema);
|
||||
const valid = Boolean(validate(data));
|
||||
const errors = valid
|
||||
? []
|
||||
: (validate.errors || []).map(e => `${e.instancePath || '#'} ${e.message}`);
|
||||
|
||||
return { valid, errors };
|
||||
}
|
||||
export default validateJSON;
|
||||
// Generation time: 8.566s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user