MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / trackImport

Method trackImport

src/utils/usage-tracker.ts:52–65  ·  view source on GitHub ↗
(importSource: string, importingFile: string, line: number = 1)

Source from the content-addressed store, hash-verified

50 private exports: Map<string, string[]> = new Map();
51
52 trackImport(importSource: string, importingFile: string, line: number = 1): void {
53 // Normalize
54 const normalized = this.normalizeSource(importSource);
55 if (!normalized) return;
56
57 const existing = this.usages.get(normalized) || [];
58 const relPath = this.toRelativePath(importingFile);
59
60 // Avoid duplicates
61 if (!existing.some((u) => u.file === relPath && u.line === line)) {
62 existing.push({ file: relPath, line });
63 this.usages.set(normalized, existing);
64 }
65 }
66
67 trackExport(filePath: string, exportName: string): void {
68 const relPath = this.toRelativePath(filePath);

Callers 2

indexMethod · 0.95

Calls 4

normalizeSourceMethod · 0.95
toRelativePathMethod · 0.95
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected