* A digest of what resolution reads from one config file: a go.mod's module * path, a tsconfig / jsconfig's `extends`, `baseUrl` and `paths`, what a Cargo * manifest declares (see `cargoManifestFields`), the include directories a * compile database names. Not of its bytes: a dependency bump, a `s
(abs: string, projectRoot: string)
| 313 | * every one. |
| 314 | */ |
| 315 | function moduleConfigDigest(abs: string, projectRoot: string): string { |
| 316 | const file = path.basename(abs); |
| 317 | const read = file === 'go.mod' ? loadGoModule(path.dirname(abs))?.modulePath ?? '' |
| 318 | : file === 'Cargo.toml' ? cargoManifestDigestText(abs) |
| 319 | : file === 'compile_commands.json' ? (readCompileDbIncludeDirs(abs, projectRoot) ?? []).join('\n') |
| 320 | : aliasConfigFields(abs) ?? ''; |
| 321 | return createHash('sha256').update(read).digest('hex').slice(0, 16); |
| 322 | } |
| 323 | |
| 324 | function cargoManifestDigestText(abs: string): string { |
| 325 | try { |
no test coverage detected