MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / parentDir

Function parentDir

runtime/src/specs.js:18–25  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

16};
17
18export const parentDir = (dir) => {
19 if (dir === '') return null;
20 const trimmed = dir.endsWith('/') ? dir.slice(0, -1) : dir;
21 const sch = trimmed.indexOf('://');
22 if (sch !== -1 && !trimmed.slice(sch + 3).includes('/')) return null;
23 const i = trimmed.lastIndexOf('/');
24 return i === -1 ? '' : trimmed.slice(0, i + 1);
25};
26
27export const joinRel = (base, target) => {
28 if (target.includes('://') || target.startsWith('/')) return target;

Callers 1

joinRelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected