refactor(reference): remove redundant source suffix checks (#17362)

This commit is contained in:
Vincent Koc
2026-12-06 10:40:44 +08:00
committed by GitHub
parent 865ab5819a
commit 06d1cafd2e
+3 -7
View File
@@ -278,9 +278,9 @@ const filenameIsGenerated = (filename: string): boolean => {
if (lower.endsWith(".min.js") || lower.endsWith(".min.css")) return true;
if (lower.endsWith(".map")) return true;
if (lower.endsWith(".lock")) return true;
if (lower.endsWith(".d.ts") || lower.endsWith(".d.ts.map")) return true;
if (lower.endsWith(".d.mts") || lower.endsWith(".d.mts.map")) return true;
if (lower.endsWith(".d.cts") || lower.endsWith(".d.cts.map")) return true;
if (lower.endsWith(".d.ts")) return true;
if (lower.endsWith(".d.mts")) return true;
if (lower.endsWith(".d.cts")) return true;
return false;
};
@@ -325,10 +325,6 @@ export const detectReferenceSourceLanguage = (path: string): string | null => {
if (lower === "dockerfile" || lower.startsWith("dockerfile."))
return "Dockerfile";
if (lower.endsWith(".d.ts")) return "TypeScript";
if (lower.endsWith(".d.mts")) return "TypeScript";
if (lower.endsWith(".d.cts")) return "TypeScript";
const extension = sourceExtension(filename);
if (extension === "C") return "C++";
if (extension === "M") return "Objective-C++";