MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / jointQuery

Function jointQuery

frontend/packages/common/src/utils/postcat.tsx:215–226  ·  view source on GitHub ↗
(url = '', query: SafeAny[])

Source from the content-addressed store, hash-verified

213}
214
215const jointQuery = (url = '', query: SafeAny[]) => {
216 //Joint query
217 let search = ''
218 query.forEach((val) => {
219 if (!(val.name && val.isRequired)) {
220 return
221 }
222 search += `${val.name}=${val.paramAttr?.example || ''}&`
223 })
224 search = search ? `?${search.slice(0, -1)}` : ''
225 return `${url.split('?')[0]}${search}`
226}
227
228export function extractBraceContent(uri: string): string[] | null {
229 // Regular expression to match content inside curly braces

Callers 1

syncUrlAndQueryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected