MCPcopy Index your code
hub / github.com/massCodeIO/massCode / joinUrl

Function joinUrl

src/main/http/import/openapi.ts:114–125  ·  view source on GitHub ↗
(baseUrl: string, path: string)

Source from the content-addressed store, hash-verified

112}
113
114function joinUrl(baseUrl: string, path: string): string {
115 const normalizedBase = openApiTemplateToVariables(baseUrl).replace(
116 /\/+$/g,
117 '',
118 )
119 const normalizedPath = openApiTemplateToVariables(path)
120 if (!normalizedBase)
121 return normalizedPath
122 if (!normalizedPath)
123 return normalizedBase
124 return `${normalizedBase}/${normalizedPath.replace(/^\/+/g, '')}`
125}
126
127function getInfo(raw: UnknownRecord): UnknownRecord {
128 return isRecord(raw.info) ? raw.info : {}

Callers 1

parseOperationFunction · 0.85

Calls 1

Tested by

no test coverage detected