MCPcopy Index your code
hub / github.com/SchemaStore/schemastore / printSchemaValidationErrorAndExit

Function printSchemaValidationErrorAndExit

cli.js:558–571  ·  view source on GitHub ↗

* @param {string} filepath * @param {string} schemaFilepath * @param {unknown[] | null | undefined} ajvErrors * @returns {never}

(
  filepath,
  schemaFilepath,
  ajvErrors,
)

Source from the content-addressed store, hash-verified

556 * @returns {never}
557 */
558function printSchemaValidationErrorAndExit(
559 filepath,
560 schemaFilepath,
561 ajvErrors,
562) {
563 printErrorAndExit(
564 null,
565 [
566 `Failed to validate file "${filepath}" against schema file "./${schemaFilepath}"`,
567 `Showing first error out of ${ajvErrors?.length ?? '?'} total error(s)`,
568 ],
569 util.formatWithOptions({ colors: true }, '%O', ajvErrors?.[0] ?? '???'),
570 )
571}
572
573async function taskNewSchema() {
574 const rl = readline.createInterface({

Callers 3

onPositiveTestFileFunction · 0.85
onSchemaFileFunction · 0.85

Calls 1

printErrorAndExitFunction · 0.85

Tested by

no test coverage detected