MCPcopy
hub / github.com/remotely-save/remotely-save / getParentFolder

Function getParentFolder

src/misc.ts:217–227  ·  view source on GitHub ↗
(a: string)

Source from the content-addressed store, hash-verified

215 * @returns
216 */
217export const getParentFolder = (a: string) => {
218 const b = path.posix.dirname(a);
219 if (b === "." || b === "/") {
220 // the root
221 return "/";
222 }
223 if (b.endsWith("/")) {
224 return b;
225 }
226 return `${b}/`;
227};
228
229/**
230 * https://stackoverflow.com/questions/54511144

Callers 6

getSyncPlanInplaceFunction · 0.90
statMethod · 0.90
mkdirMethod · 0.90
writeFileMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected