MCPcopy Create free account
hub / github.com/agisboye/app-store-server-api / addQuery

Method addQuery

src/AppStoreServerAPI.ts:325–345  ·  view source on GitHub ↗

* Serializes a query object into a query string and appends it * the provided path.

(path: string, query: QueryConvertible)

Source from the content-addressed store, hash-verified

323 * the provided path.
324 */
325 private addQuery(path: string, query: QueryConvertible): string {
326 const params = new URLSearchParams()
327
328 for (const [key, value] of Object.entries(query)) {
329 if (Array.isArray(value)) {
330 for (const item of value) {
331 params.append(key, item.toString())
332 }
333 } else {
334 params.set(key, value.toString())
335 }
336 }
337
338 const queryString = params.toString()
339
340 if (queryString === "") {
341 return path
342 } else {
343 return `${path}?${queryString}`
344 }
345 }
346}

Callers 4

getTransactionHistoryMethod · 0.95
getRefundHistoryMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected