MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / appendUrlPathSuffix

Function appendUrlPathSuffix

src/lib/openFolder.js:1027–1034  ·  view source on GitHub ↗
(url, suffix)

Source from the content-addressed store, hash-verified

1025}
1026
1027function appendUrlPathSuffix(url, suffix) {
1028 if (!suffix) return url;
1029 const { url: parsedUrl, query } = Url.parse(url);
1030 if (parsedUrl.endsWith("/") && suffix.startsWith("/")) {
1031 return parsedUrl.slice(0, -1) + suffix + query;
1032 }
1033 return parsedUrl + suffix + query;
1034}
1035
1036function preserveTrailingSlashShape(url, sourceUrl) {
1037 const { url: sourcePath } = Url.parse(sourceUrl);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected