MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / joinPath

Function joinPath

Support/SingleFileLibs/javascript/app.js:249–259  ·  view source on GitHub ↗
(dir, rel)

Source from the content-addressed store, hash-verified

247 // Amalgamation
248
249 function joinPath(dir, rel) {
250 if (rel.startsWith('/')) return rel.slice(1);
251 const parts = (dir + '/' + rel).split('/');
252 const stack = [];
253 for (const part of parts) {
254 if (part === '' || part === '.') continue;
255 if (part === '..') { stack.pop(); continue; }
256 stack.push(part);
257 }
258 return stack.join('/');
259 }
260
261 function divider() {
262 return '//' + '-'.repeat(118) + '\n';

Callers

nothing calls this directly

Calls 4

startsWithMethod · 0.80
popMethod · 0.80
pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected