Skip to content

Commit ac2185d

Browse files
committed
update scripts/generate-endpoint-names
1 parent b221a3d commit ac2185d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/generate-endpoint-names.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ for (const url of Object.keys(PATHS_SPEC)) {
6262
}
6363
}
6464

65+
const existingEndpointUrls = Object.keys(PATHS_SPEC)
66+
const nonExistentEndpointUrls = Object.keys(ENDPOINT_NAMES).filter(
67+
(url) => !existingEndpointUrls.includes(url)
68+
)
69+
70+
if (nonExistentEndpointUrls.length !== 0) {
71+
throw new Error(
72+
[
73+
`Non-existent URLs:`,
74+
...nonExistentEndpointUrls.map((url) => `- ${url}`),
75+
].join('\n')
76+
)
77+
}
78+
6579
fs.writeFileSync(
6680
endpointNamesPath,
6781
`${JSON.stringify(deepsort(ENDPOINT_NAMES), null, 2)}\n`

0 commit comments

Comments
 (0)