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

Function buildVantaUrl

apps/sim/tools/vanta/utils.ts:271–290  ·  view source on GitHub ↗
(
  baseUrl: string,
  path: string,
  query?: Record<string, string | number | boolean | string[] | null | undefined>
)

Source from the content-addressed store, hash-verified

269 * value. Array values are appended as repeated parameters.
270 */
271export function buildVantaUrl(
272 baseUrl: string,
273 path: string,
274 query?: Record<string, string | number | boolean | string[] | null | undefined>
275): string {
276 const url = new URL(`${baseUrl}/v1${path}`)
277 if (query) {
278 for (const [key, value] of Object.entries(query)) {
279 if (value == null || value === '') continue
280 if (Array.isArray(value)) {
281 for (const entry of value) {
282 url.searchParams.append(key, entry)
283 }
284 } else {
285 url.searchParams.set(key, String(value))
286 }
287 }
288 }
289 return url.toString()
290}
291
292/**
293 * Splits a comma-separated filter value into trimmed entries, returning

Callers 3

buildVantaApiRequestFunction · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls 2

setMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected