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

Function preserveTrailingSlashShape

src/lib/openFolder.js:1036–1044  ·  view source on GitHub ↗
(url, sourceUrl)

Source from the content-addressed store, hash-verified

1034}
1035
1036function preserveTrailingSlashShape(url, sourceUrl) {
1037 const { url: sourcePath } = Url.parse(sourceUrl);
1038 if (!sourcePath.endsWith("/")) return url;
1039
1040 const { url: targetPath, query } = Url.parse(url);
1041 if (targetPath.endsWith("/")) return url;
1042
1043 return `${targetPath}/${query}`;
1044}
1045
1046function getListStateEntries(listState) {
1047 if (!listState) return [];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected