We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
extractImports
1 parent 6d86696 commit 0eddfc4Copy full SHA for 0eddfc4
src/core/declaration.ts
@@ -12,7 +12,7 @@ const singlelineCommentsRE = /\/\/.*$/gm
12
13
function extractImports(code: string) {
14
// eslint-disable-next-line regexp/no-super-linear-backtracking, regexp/no-misleading-capturing-group
15
- 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]]))
16
}
17
18
export function parseDeclaration(code: string): DeclarationImports | undefined {
0 commit comments