MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / resolveEndpointUrl

Function resolveEndpointUrl

ai/ai.ts:470–476  ·  view source on GitHub ↗
(baseUrl: string, endpoint?: string)

Source from the content-addressed store, hash-verified

468 }
469 return providerConfig.url;
470};
471
472const resolveEndpointUrl = (baseUrl: string, endpoint?: string): string => {
473 if (!endpoint) return baseUrl;
474 if (/^https?:\/\//.test(endpoint)) return endpoint;
475 const base = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
476 const cleaned = endpoint.startsWith("/") ? endpoint.slice(1) : endpoint;
477 return new URL(cleaned, base).toString();
478};
479

Calls

no outgoing calls

Tested by

no test coverage detected