mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 17:23:37 +08:00
refactor(reference): remove redundant source suffix checks (#17362)
This commit is contained in:
@@ -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++";
|
||||
|
||||
Reference in New Issue
Block a user