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