mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-06-07 20:12:13 +00:00
Docs: Update benchmark for anthropic/claude-opus-4.8 EFF:medium
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
const validateJSON = async (data, schema) => {
|
||||
try {
|
||||
const { default: Ajv } = await import("https://esm.sh/ajv@8");
|
||||
const ajv = new Ajv({ allErrors: true, strict: false });
|
||||
const validate = ajv.compile(schema);
|
||||
const valid = validate(data);
|
||||
return {
|
||||
valid,
|
||||
errors: valid
|
||||
? []
|
||||
: (validate.errors || []).map(
|
||||
(e) => `${e.instancePath || "/"} ${e.message}`.trim()
|
||||
),
|
||||
};
|
||||
} catch (err) {
|
||||
return { valid: false, errors: [err.message] };
|
||||
}
|
||||
};
|
||||
|
||||
export { validateJSON };
|
||||
export default validateJSON;
|
||||
// Generation time: 5.406s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user