Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0eddfc4

Browse files
authored
fix:extractImports supports reading CRLF files (#848
1 parent6d86696 commit0eddfc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/core/declaration.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const singlelineCommentsRE = /\/\/.*$/gm
1212

1313
functionextractImports(code:string){
1414
// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/no-misleading-capturing-group
15-
returnObject.fromEntries(Array.from(code.matchAll(/['"]?([^\s'"]+)['"]?\s*:\s*(.+?)[,;\n]/g)).map(i=>[i[1],i[2]]))
15+
returnObject.fromEntries(Array.from(code.matchAll(/['"]?([^\s'"]+)['"]?\s*:\s*(.+?)[,;\r\n]/g)).map(i=>[i[1],i[2]]))
1616
}
1717

1818
exportfunctionparseDeclaration(code:string):DeclarationImports|undefined{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp