* Short stable identifier for a project root — used in tmpdir/pipe names. * * Hashed over canonicalProjectRoot, never a raw `path.resolve`: the key * is a rendezvous, so every spelling of one directory must land on one name or * a proxy probes a pipe the running daemon never bound (see t
(projectRoot: string)
| 44 | * a proxy probes a pipe the running daemon never bound (see that function). |
| 45 | */ |
| 46 | function projectHash(projectRoot: string): string { |
| 47 | // `crypto` is the slowest builtin to load, and every CLI command loads this file. |
| 48 | const { createHash } = require('crypto') as typeof import('crypto'); |
| 49 | return createHash('sha256').update(canonicalProjectRoot(projectRoot)).digest('hex').slice(0, 16); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * The deterministic tmpdir socket path for `projectRoot` — the fallback used |
no test coverage detected