MCPcopy Create free account
hub / github.com/CatMuse/HiNote / getStoragePathForFile

Method getStoragePathForFile

src/storage/FileMappingStore.ts:54–64  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

52 }
53
54 getStoragePathForFile(filePath: string): string {
55 let safeFileName = this.fileMapping.get(filePath);
56
57 if (!safeFileName) {
58 safeFileName = FilePathUtils.toSafeFileName(filePath);
59 this.fileMapping.set(filePath, safeFileName);
60 this.save().catch(console.error);
61 }
62
63 return `${FilePathUtils.getHighlightsDir(this.vaultPath)}/${safeFileName}`;
64 }
65
66 private getMappingPath(): string {
67 return `${FilePathUtils.getMetadataDir(this.vaultPath)}/file-mapping.json`;

Callers

nothing calls this directly

Calls 4

saveMethod · 0.95
toSafeFileNameMethod · 0.80
setMethod · 0.80
getHighlightsDirMethod · 0.80

Tested by

no test coverage detected