fix(docs): handle duplicated routes in docs

This commit is contained in:
pseudoyu
2024-10-23 11:43:12 +08:00
parent 45fa8e5dd8
commit 52e72e2c60

View File

@@ -96,8 +96,17 @@ function generateMd(lang) {
}
});
const processedPaths = new Set();
for (const realPath of realPaths) {
const data = docs[category][namespace].routes[realPath];
if (Array.isArray(data.path)) {
if (processedPaths.has(data.path[0])) {
continue;
}
processedPaths.add(data.path[0]);
}
const test = testResult.find((t) => t.title === realPath);
const parsedTest = test
? {