MCPcopy Create free account
hub / github.com/codag-megalith/codag-visualizer / checkFiles

Method checkFiles

frontend/src/cache.ts:392–416  ·  view source on GitHub ↗

* Check multiple files, return cached vs uncached

(filePaths: string[], contents: string[])

Source from the content-addressed store, hash-verified

390 * Check multiple files, return cached vs uncached
391 */
392 async checkFiles(filePaths: string[], contents: string[]): Promise<{
393 cached: { path: string; content: string }[];
394 uncached: { path: string; content: string }[];
395 }> {
396 await this.initPromise;
397
398 const cached: { path: string; content: string }[] = [];
399 const uncached: { path: string; content: string }[] = [];
400
401 for (let i = 0; i < filePaths.length; i++) {
402 const fp = filePaths[i];
403 const content = contents[i];
404 const hash = this.hashContentAST(content, fp);
405 const normalizedPath = this.toRelativePath(fp);
406 const cachedEntry = this.files[normalizedPath];
407
408 if (this.isFileValid(fp, hash)) {
409 cached.push({ path: fp, content });
410 } else {
411 uncached.push({ path: fp, content });
412 }
413 }
414
415 return { cached, uncached };
416 }
417
418 // =========================================================================
419 // Store Analysis Results

Callers 2

activateFunction · 0.95
analyzeWorkspaceFunction · 0.80

Calls 3

hashContentASTMethod · 0.95
toRelativePathMethod · 0.95
isFileValidMethod · 0.95

Tested by

no test coverage detected