MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / joinRemoteParts

Function joinRemoteParts

packages/telemetry/src/remote.ts:22–34  ·  view source on GitHub ↗
(
  host: string | undefined,
  port: string | undefined,
  path: string | undefined,
)

Source from the content-addressed store, hash-verified

20}
21
22function joinRemoteParts(
23 host: string | undefined,
24 port: string | undefined,
25 path: string | undefined,
26): string {
27 const normalizedHost = host?.trim() ?? '';
28 const normalizedPort = port?.trim() ?? '';
29 const normalizedPath = stripGitSuffix(path ?? '');
30 const parts = [normalizedHost];
31 if (normalizedPort.length > 0) parts.push(normalizedPort);
32 if (normalizedPath.length > 0) parts.push(normalizedPath);
33 return parts.join('/');
34}
35
36function stripGitSuffix(value: string): string {
37 let normalized = value.trim().replace(/^\/+/, '').replace(/\/+$/, '');

Callers 1

normalizeRemoteFunction · 0.85

Calls 2

stripGitSuffixFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected