(input: {
rawPatch: string;
cwd?: string;
fileExts?: string[];
})
| 402 | } |
| 403 | |
| 404 | export function semanticDiffCacheKey(input: { |
| 405 | rawPatch: string; |
| 406 | cwd?: string; |
| 407 | fileExts?: string[]; |
| 408 | }): string { |
| 409 | const hash = createHash("sha256"); |
| 410 | hash.update(input.rawPatch); |
| 411 | hash.update("\0"); |
| 412 | hash.update(input.cwd ?? ""); |
| 413 | hash.update("\0"); |
| 414 | hash.update(normalizeSemanticDiffFileExts(input.fileExts).join("\0")); |
| 415 | return hash.digest("hex"); |
| 416 | } |
| 417 | |
| 418 | export class SemanticDiffResponseCache { |
| 419 | private readonly cache = new Map<string, SemanticDiffResponse>(); |
no test coverage detected