MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / maybeShortenFilePath

Function maybeShortenFilePath

source code/utils/fileHistory.ts:869–878  ·  view source on GitHub ↗

* Use the relative path as the key to reduce session storage space for tracking.

(filePath: string)

Source from the content-addressed store, hash-verified

867 * Use the relative path as the key to reduce session storage space for tracking.
868 */
869function maybeShortenFilePath(filePath: string): string {
870 if (!isAbsolute(filePath)) {
871 return filePath
872 }
873 const cwd = getOriginalCwd()
874 if (filePath.startsWith(cwd)) {
875 return relative(cwd, filePath)
876 }
877 return filePath
878}
879
880function maybeExpandFilePath(filePath: string): string {
881 if (isAbsolute(filePath)) {

Callers 2

fileHistoryTrackEditFunction · 0.85

Calls 1

getOriginalCwdFunction · 0.85

Tested by

no test coverage detected