MCPcopy Create free account
hub / github.com/decaporg/decap-cms / constructUrlWithParams

Function constructUrlWithParams

packages/decap-cms-lib-util/src/API.ts:172–183  ·  view source on GitHub ↗
(url: string, params?: ParamObject)

Source from the content-addressed store, hash-verified

170};
171
172function constructUrlWithParams(url: string, params?: ParamObject) {
173 if (params) {
174 const paramList = [];
175 for (const key in params) {
176 paramList.push(`${key}=${encodeURIComponent(params[key])}`);
177 }
178 if (paramList.length) {
179 url += `?${paramList.join('&')}`;
180 }
181 }
182 return url;
183}
184
185async function constructRequestHeaders(headerConfig: HeaderConfig) {
186 const { token, headers } = headerConfig;

Callers 1

apiRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected