(source)
| 382 | } |
| 383 | |
| 384 | function parseRelativeImports(source) { |
| 385 | const map = new Map() |
| 386 | for (const match of source.matchAll(/^import\s+\{([^}]+)\}\s+from\s+'(\.[^']+)'/gm)) { |
| 387 | const names = match[1] |
| 388 | .split(',') |
| 389 | .map(s => s.trim()) |
| 390 | .filter(Boolean) |
| 391 | .map(s => s.split(/\s+as\s+/)[0].trim()) |
| 392 | for (const name of names) { |
| 393 | map.set(name, match[2]) |
| 394 | } |
| 395 | } |
| 396 | return map |
| 397 | } |
| 398 | |
| 399 | function parseRelativeRequires(source) { |
| 400 | const map = new Map() |
no test coverage detected