MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / urlWithSearchParams

Function urlWithSearchParams

packages/core/src/searchParams.ts:1–16  ·  view source on GitHub ↗
(
  url: string,
  params: Record<string, string | number | boolean> | undefined
)

Source from the content-addressed store, hash-verified

1export function urlWithSearchParams(
2 url: string,
3 params: Record<string, string | number | boolean> | undefined
4) {
5 if (!params) {
6 return url;
7 }
8
9 const urlObj = new URL(url);
10 for (const [key, value] of Object.entries(params)) {
11 if (value !== undefined) {
12 urlObj.searchParams.append(key, String(value));
13 }
14 }
15 return urlObj.toString();
16}

Callers 3

useRunDetailsFunction · 0.90
getRunMethod · 0.90
getRunsMethod · 0.90

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…