* Lowercased basename stems of the hyphen-named indexed files, stem → paths. * A stem drops only the LAST extension (`a-b.module.scss` → `a-b.module`), so * a bare kebab token can't accidentally pin a same-named stylesheet or * `.d.ts` sibling of the source file it names; an extension-less basena
(indexedPaths: readonly string[])
| 159 | * near-empty in repos that don't name files this way. |
| 160 | */ |
| 161 | function buildBasenameStems(indexedPaths: readonly string[]): Map<string, string[]> { |
| 162 | const stems = new Map<string, string[]>(); |
| 163 | for (const p of indexedPaths) { |
| 164 | const basename = p.slice(Math.max(p.lastIndexOf('/'), p.lastIndexOf('\\')) + 1); |
| 165 | if (!basename.includes('-')) continue; |
| 166 | const stem = basename.replace(LAST_EXTENSION, '').toLowerCase(); |
| 167 | if (!stem) continue; |
| 168 | const existing = stems.get(stem); |
| 169 | if (existing) existing.push(p); |
| 170 | else stems.set(stem, [p]); |
| 171 | } |
| 172 | return stems; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Line references that ride along in agent-written paths: `foo.ts:123`, |
no test coverage detected