MCPcopy Index your code
hub / github.com/awesome-opencode/awesome-opencode / getValidator

Function getValidator

scripts/utils/validation.js:21–28  ·  view source on GitHub ↗

* Get the compiled validation function * @returns {Function} AJV validate function

()

Source from the content-addressed store, hash-verified

19 * @returns {Function} AJV validate function
20 */
21function getValidator() {
22 if (!validateFn) {
23 const schemaPath = path.join(__dirname, '../../data/schema.json');
24 const schema = JSON.parse(fs.readFileSync(schemaPath, 'utf8'));
25 validateFn = ajv.compile(schema);
26 }
27 return validateFn;
28}
29
30/**
31 * Validate an entry against the schema

Callers 1

validateEntryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected