MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / appendParam

Function appendParam

frontend/packages/common/src/hooks/http.ts:73–81  ·  view source on GitHub ↗
(params: URLSearchParams, key: string, value: Array<string> | string)

Source from the content-addressed store, hash-verified

71}
72
73function appendParam(params: URLSearchParams, key: string, value: Array<string> | string) {
74 if (value !== undefined && value !== null) {
75 if (Array.isArray(value)) {
76 value.forEach((item) => params.append(key, item))
77 } else {
78 params.append(key, value as string)
79 }
80 }
81}
82
83function isJsonHttp(headers: Headers | { [k: string]: string }): boolean {
84 const contentType = headers instanceof Headers ? headers.get('Content-Type') : headers['Content-Type']

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected