From 31c393f15ccd7442ab407701be8715a9fc5d7d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=9B=E6=9E=97?= <289420843@qq.com> Date: Tue, 24 Jun 2025 17:09:47 +0800 Subject: [PATCH] fix: extractImports supported CRLF files --- src/core/declaration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/declaration.ts b/src/core/declaration.ts index 7259be71..cd92106e 100644 --- a/src/core/declaration.ts +++ b/src/core/declaration.ts @@ -12,7 +12,7 @@ const singlelineCommentsRE = /\/\/.*$/gm function extractImports(code: string) { // eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/no-misleading-capturing-group - return Object.fromEntries(Array.from(code.matchAll(/['"]?([^\s'"]+)['"]?\s*:\s*(.+?)[,;\n]/g)).map(i => [i[1], i[2]])) + return Object.fromEntries(Array.from(code.matchAll(/['"]?([^\s'"]+)['"]?\s*:\s*(.+?)[,;\r\n]/g)).map(i => [i[1], i[2]])) } export function parseDeclaration(code: string): DeclarationImports | undefined {