* The `build` folder below a `src/` folder that file `rel` sits in, with a * trailing slash (`src/build/` for `src/build/legacy/page.tsx`), or null. A JVM * package named `build` (#1642) does not count.
(rel: string)
| 370 | * package named `build` (#1642) does not count. |
| 371 | */ |
| 372 | function srcBuildFolderOf(rel: string): string | null { |
| 373 | if (!/(?:^|\/)build\//i.test(rel)) return null; |
| 374 | const parts = rel.split('/'); |
| 375 | let inSrc = false; |
| 376 | for (let i = 0; i < parts.length - 1; i++) { |
| 377 | const part = parts[i]!.toLowerCase(); |
| 378 | if (part === 'src') { |
| 379 | inSrc = true; |
| 380 | } else if (part === 'build' && inSrc) { |
| 381 | const folder = parts.slice(0, i + 1).join('/') + '/'; |
| 382 | return jvmBuildPackages.ignores(folder) ? null : folder; |
| 383 | } |
| 384 | } |
| 385 | return null; |
| 386 | } |
| 387 | |
| 388 | /** |
| 389 | * When `rel` is a file in a `build` folder below `src/` that a build step could |
no test coverage detected