MCPcopy Create free account
hub / github.com/json-editor/json-editor / validate$DataFormat

Function validate$DataFormat

docs/scripts/ajv-validator.js:371–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

369 else
370 validateFormat();
371 function validate$DataFormat() {
372 const fmts = gen.scopeValue("formats", {
373 ref: self.formats,
374 code: opts.code.formats,
375 });
376 const fmt = gen.const("fmt", codegen_1._ `${fmts}[${fCxt.schemaCode}]`);
377 cxt.fail$data(codegen_1.or(codegen_1._ `typeof ${fmt} != "object"`, codegen_1._ `${fmt} instanceof RegExp`, codegen_1._ `typeof ${fmt}.compare != "function"`, compareCode(fmt)));
378 }
379 function validateFormat() {
380 const format = fCxt.schema;
381 const fmtDef = self.formats[format];

Callers 1

codeFunction · 0.85

Calls 9

compareCodeFunction · 0.85
unknownFmtFunction · 0.85
invalidFmtFunction · 0.85
scopeValueMethod · 0.80
fail$dataMethod · 0.80
letMethod · 0.80
assignMethod · 0.80
constMethod · 0.45
ifMethod · 0.45

Tested by

no test coverage detected