MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / buildUrl

Function buildUrl

packages/server/test/adapter/tanstack-start.test.ts:40–55  ·  view source on GitHub ↗
(method: string)

Source from the content-addressed store, hash-verified

38 };
39
40 const buildUrl = (method: string) => {
41 const baseUrl = `http://localhost${apiPath}`;
42 if (method === 'GET' || method === 'DELETE') {
43 const url = new URL(baseUrl);
44 if (qArg) {
45 url.searchParams.set('q', JSON.stringify(qArg));
46 }
47 if (otherArgs) {
48 Object.entries(otherArgs).forEach(([key, value]) => {
49 url.searchParams.set(key, String(value));
50 });
51 }
52 return url.toString();
53 }
54 return baseUrl;
55 };
56
57 const executeRequest = async (method: string, body?: any) => {
58 const url = buildUrl(method);

Callers 1

executeRequestFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected