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

Function constructUrlWithParams

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

Source from the content-addressed store, hash-verified

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

Callers 1

apiRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected