`src/bin/codegraph.ts` -> `src/bin`; a root file -> `.`.
(filePath: string)
| 418 | |
| 419 | /** `src/bin/codegraph.ts` -> `src/bin`; a root file -> `.`. */ |
| 420 | function directoryOf(filePath: string): string { |
| 421 | const normalized = filePath.replace(/\\/g, '/'); |
| 422 | const cut = normalized.lastIndexOf('/'); |
| 423 | return cut < 0 ? '.' : normalized.slice(0, cut); |
| 424 | } |