MCPcopy Create free account
hub / github.com/json-editor/json-editor / useKeyword

Function useKeyword

docs/scripts/ajv-validator.js:3378–3382  ·  view source on GitHub ↗
(gen, keyword, result)

Source from the content-addressed store, hash-verified

3376 throw new Error("async keyword in sync schema");
3377 }
3378 function useKeyword(gen, keyword, result) {
3379 if (result === undefined)
3380 throw new Error(`keyword "${keyword}" failed to compile`);
3381 return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
3382 }
3383 function validSchemaType(schema, schemaType, allowUndefined = false) {
3384 // TODO add tests
3385 return (!schemaType.length ||

Callers 2

macroKeywordCodeFunction · 0.85
funcKeywordCodeFunction · 0.85

Calls 1

scopeValueMethod · 0.80

Tested by

no test coverage detected