MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / normalizeBaseUrl

Function normalizeBaseUrl

packages/sync/src/data-source-manager.ts:22–31  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

20}
21
22export function normalizeBaseUrl(input: string): string {
23 let url = input.trim().replace(/\/+$/, '')
24 if (url && !/^https?:\/\//i.test(url)) {
25 url = `http://${url}`
26 }
27 if (url && !url.endsWith('/api/v1')) {
28 url = url.replace(/\/api\/v1$/, '') + '/api/v1'
29 }
30 return url
31}
32
33function isValidDataSourceArray(data: unknown): data is DataSource[] {
34 if (!Array.isArray(data)) return false

Callers 4

fetchRemoteSessionsFunction · 0.90
registerAutomationRoutesFunction · 0.90
addMethod · 0.70
updateMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected