MCPcopy
hub / github.com/callumalpass/tasknotes / rename

Method rename

tests/__mocks__/obsidian.ts:98–111  ·  view source on GitHub ↗
(oldPath: string, newPath: string)

Source from the content-addressed store, hash-verified

96 }
97
98 rename(oldPath: string, newPath: string): void {
99 const oldNormalized = this.normalizePath(oldPath);
100 const newNormalized = this.normalizePath(newPath);
101
102 const file = this.files.get(oldNormalized);
103 if (file) {
104 this.files.delete(oldNormalized);
105 file.path = newNormalized;
106 file.name = this.getFileName(newNormalized);
107 file.basename = this.getBaseName(newNormalized);
108 this.files.set(newNormalized, file);
109 this.emitter.emit('rename', file, oldNormalized);
110 }
111 }
112
113 exists(path: string): boolean {
114 const normalizedPath = this.normalizePath(path);

Callers

nothing calls this directly

Calls 7

normalizePathMethod · 0.95
getFileNameMethod · 0.95
getBaseNameMethod · 0.95
emitMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected