()
| 1291 | } |
| 1292 | |
| 1293 | function assertCatalogJsonHasNoDuplicateNames() { |
| 1294 | /** @type {string[]} */ |
| 1295 | const schemaNames = Catalog.schemas.map((entry) => entry.name) |
| 1296 | /** @type {string[]} */ |
| 1297 | |
| 1298 | for (const catalogEntry of Catalog.schemas) { |
| 1299 | if ( |
| 1300 | schemaNames.indexOf(catalogEntry.name) !== |
| 1301 | schemaNames.lastIndexOf(catalogEntry.name) |
| 1302 | ) { |
| 1303 | const duplicateEntry = |
| 1304 | Catalog.schemas[schemaNames.lastIndexOf(catalogEntry.name)] |
| 1305 | printErrorAndExit(new Error(), [ |
| 1306 | `Found two schema entries with duplicate "name" of "${catalogEntry.name}" in file "${CatalogFile}"`, |
| 1307 | `The first entry has url "${catalogEntry.url}"`, |
| 1308 | `The second entry has url "${duplicateEntry.url}"`, |
| 1309 | `Expected the "name" property of schema entries to be unique`, |
| 1310 | ]) |
| 1311 | } |
| 1312 | } |
| 1313 | } |
| 1314 | |
| 1315 | function assertCatalogJsonHasNoBadFields() { |
| 1316 | for (const catalogEntry of Catalog.schemas) { |
no test coverage detected