MCPcopy Index your code
hub / github.com/simstudioai/sim / extractApiVersionFromUrl

Function extractApiVersionFromUrl

apps/sim/providers/azure-openai/utils.ts:110–119  ·  view source on GitHub ↗
(fullUrl: string)

Source from the content-addressed store, hash-verified

108 * @returns The api-version or null if not found
109 */
110export function extractApiVersionFromUrl(fullUrl: string): string | null {
111 try {
112 const url = new URL(fullUrl)
113 return url.searchParams.get('api-version')
114 } catch {
115 // Fallback regex for malformed URLs
116 const match = fullUrl.match(/[?&]api-version=([^&]+)/i)
117 return match ? match[1] : null
118 }
119}

Callers 1

index.tsFile · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected