MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / stripEmbeddedCredentials

Function stripEmbeddedCredentials

packages/worker-utils/src/git-url.ts:104–116  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

102}
103
104function stripEmbeddedCredentials(url: string): string {
105 const authorityMarker = '//';
106 const authorityMarkerIndex = url.indexOf(authorityMarker);
107 if (authorityMarkerIndex === -1) return url;
108
109 const authorityStart = authorityMarkerIndex + authorityMarker.length;
110 const pathStart = url.indexOf('/', authorityStart);
111 const authorityEnd = pathStart === -1 ? url.length : pathStart;
112 const atIndex = url.lastIndexOf('@', authorityEnd - 1);
113 if (atIndex < authorityStart) return url;
114
115 return `${url.slice(0, authorityStart)}${url.slice(atIndex + 1)}`;
116}
117
118function coordinatesFromHostAndPath(
119 host: string,

Callers 1

parseGitUrlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected