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

Function joinPath

Support/SingleFileLibs/javascript/amalgamationCore.js:84–94  ·  view source on GitHub ↗
(dir, rel)

Source from the content-addressed store, hash-verified

82}
83
84function joinPath(dir, rel) {
85 if (rel.startsWith('/')) return rel.slice(1);
86 const parts = (dir + '/' + rel).split('/');
87 const stack = [];
88 for (const part of parts) {
89 if (part === '' || part === '.') continue;
90 if (part === '..') { stack.pop(); continue; }
91 stack.push(part);
92 }
93 return stack.join('/');
94}
95
96function libraryNameFromPath(path) {
97 const parts = path.split('/');

Callers 2

processFileRecursivelyFunction · 0.70
resolveToPathFunction · 0.70

Calls 4

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

Tested by

no test coverage detected