mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-03-17 11:21:00 +00:00
Docs: Update benchmark for minimax/minimax-m2.5
This commit is contained in:
14
tests/8_json_validator/outputs/minimax_minimax-m2.5.js
Normal file
14
tests/8_json_validator/outputs/minimax_minimax-m2.5.js
Normal file
@@ -0,0 +1,14 @@
|
||||
async function validateJSON(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.message) };
|
||||
} catch (e) {
|
||||
return { valid: false, errors: [e.message] };
|
||||
}
|
||||
}
|
||||
export default validateJSON;
|
||||
// Generation time: 35.988s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user