MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / buildUrl

Function buildUrl

wxapp/feihe.js:95–101  ·  view source on GitHub ↗
(apiPath, query = {})

Source from the content-addressed store, hash-verified

93}
94
95function buildUrl(apiPath, query = {}) {
96 const params = new URLSearchParams();
97 Object.entries(query || {}).forEach(([key, value]) => {
98 if (value !== undefined && value !== null) params.append(key, String(value));
99 });
100 return `${API_BASE}${apiPath}${params.toString() ? `?${params.toString()}` : ""}`;
101}
102
103class Task {
104 constructor(account) {

Callers 1

requestMethod · 0.85

Calls 1

forEachMethod · 0.80

Tested by

no test coverage detected