MCPcopy Index your code
hub / github.com/graphif/project-graph / splitCurrentPath

Function splitCurrentPath

app/src/utils/pathString.tsx:255–265  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

253 }
254
255 function splitCurrentPath(path: string) {
256 path = path.replace(/\\/g, "/");
257 let drive = "";
258 const driveMatch = path.match(/^([a-zA-Z]:)(\/|$)/);
259 if (driveMatch) {
260 drive = driveMatch[1];
261 path = path.substring(drive.length);
262 }
263 const parts = path.split("/").filter((p) => p !== "");
264 return { drive, parts };
265 }
266
267 function splitRelativePath(relativePath: string) {
268 relativePath = relativePath.replace(/\\/g, "/");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected