(baseUrl: string, path: string)
| 112 | } |
| 113 | |
| 114 | function 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 | |
| 127 | function getInfo(raw: UnknownRecord): UnknownRecord { |
| 128 | return isRecord(raw.info) ? raw.info : {} |
no test coverage detected