(cwd: string, patterns: string[])
| 521 | } |
| 522 | |
| 523 | function expandWorkspacePatterns(cwd: string, patterns: string[]): string[] { |
| 524 | const packagePaths: string[] = [] |
| 525 | |
| 526 | for (const pattern of patterns) { |
| 527 | if (pattern.startsWith('!')) continue |
| 528 | |
| 529 | if (pattern.includes('*')) { |
| 530 | packagePaths.push(...expandGlobPattern(cwd, pattern)) |
| 531 | } else { |
| 532 | const fullPath = path.join(cwd, pattern) |
| 533 | if (fs.existsSync(fullPath)) { |
| 534 | packagePaths.push(fullPath) |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | return [...new Set(packagePaths)] |
| 540 | } |
| 541 | |
| 542 | function expandGlobPattern(cwd: string, pattern: string): string[] { |
| 543 | const parts = pattern.split('/') |
no test coverage detected