* Check if a path is in a non-production directory (integration, sample, example, etc.) * Handles both absolute paths (/foo/integration/bar) and relative paths (integration/bar).
(lowerPath: string)
| 323 | * Handles both absolute paths (/foo/integration/bar) and relative paths (integration/bar). |
| 324 | */ |
| 325 | function matchesNonProductionDir(lowerPath: string): boolean { |
| 326 | const dirs = [ |
| 327 | 'integration', 'sample', 'samples', 'example', 'examples', |
| 328 | 'fixture', 'fixtures', 'benchmark', 'benchmarks', 'demo', 'demos', |
| 329 | ]; |
| 330 | for (const dir of dirs) { |
| 331 | if (lowerPath.includes('/' + dir + '/') || lowerPath.startsWith(dir + '/')) { |
| 332 | return true; |
| 333 | } |
| 334 | } |
| 335 | return false; |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * Bonus when a node's name matches the search query. |