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

Function schemaUrlsMustExist

cli.js:1513–1528  ·  view source on GitHub ↗
(
    /** @type {string[]} */ schemaUrls,
    /** @type {string} */ propertyName,
  )

Source from the content-addressed store, hash-verified

1511 console.info('✔️ schema-validation.jsonc has no invalid schema names')
1512
1513 const schemaUrlsMustExist = async (
1514 /** @type {string[]} */ schemaUrls,
1515 /** @type {string} */ propertyName,
1516 ) => {
1517 const /** @type {string[]} */ catalogUrls = []
1518 await forEachCatalogUrl((catalogUrl) => {
1519 catalogUrls.push(catalogUrl)
1520 })
1521 for (const schemaUrl of schemaUrls) {
1522 if (!catalogUrls.includes(schemaUrl)) {
1523 printErrorAndExit(new Error(), [
1524 `Failed to find a "url" with value of "${schemaUrl}" in file "${CatalogFile}" under property "${propertyName}[]"`,
1525 ])
1526 }
1527 }
1528 }
1529
1530 await schemaUrlsMustExist(
1531 SchemaValidation.catalogEntryNoLintNameOrDescription,

Calls 2

forEachCatalogUrlFunction · 0.85
printErrorAndExitFunction · 0.85

Tested by

no test coverage detected