MCPcopy Create free account
hub / github.com/massCodeIO/massCode / buildUrl

Function buildUrl

src/main/ipc/handlers/http.ts:115–129  ·  view source on GitHub ↗
(rawUrl: string, query: HttpQueryEntry[])

Source from the content-addressed store, hash-verified

113}
114
115function buildUrl(rawUrl: string, query: HttpQueryEntry[]): string {
116 const url = new URL(rawUrl)
117 if (query.length > 0) {
118 url.search = ''
119 }
120
121 for (const entry of query) {
122 if (entry.enabled === false)
123 continue
124 if (entry.key) {
125 url.searchParams.append(entry.key, entry.value)
126 }
127 }
128 return url.toString()
129}
130
131function toHeadersObject(entries: HttpHeaderEntry[]): Record<string, string> {
132 const obj: Record<string, string> = {}

Callers 1

executeHttpRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected