MCPcopy Create free account
hub / github.com/agegr/pi-web / encodeFilePathForApi

Function encodeFilePathForApi

lib/file-paths.ts:8–14  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

6}
7
8export function encodeFilePathForApi(filePath: string): string {
9 return normalizeFilePathSlashes(filePath)
10 .split("/")
11 .filter(Boolean)
12 .map(encodeURIComponent)
13 .join("/");
14}
15
16export function getFileName(filePath: string): string {
17 const normalized = normalizeFilePathSlashes(filePath).replace(/\/+$/, "");

Callers 5

getFileApiUrlFunction · 0.90
fetchEntriesFunction · 0.90
uploadFilesFunction · 0.90
TreeNodeFunction · 0.90
FileExplorer.tsxFile · 0.90

Calls 1

normalizeFilePathSlashesFunction · 0.70

Tested by

no test coverage detected