MCPcopy Create free account
hub / github.com/campsite/campsite / toQueryString

Method toQueryString

packages/types/generated.ts:4295–4307  ·  view source on GitHub ↗
(rawQuery?: QueryParamsType)

Source from the content-addressed store, hash-verified

4293 }
4294
4295 protected toQueryString(rawQuery?: QueryParamsType): string {
4296 const query = rawQuery || {}
4297 const keys = Object.keys(query).filter((key) => 'undefined' !== typeof query[key])
4298 return keys
4299 .map((key) =>
4300 Array.isArray(query[key])
4301 ? this.addArrayQueryParam(query, key)
4302 : query[key] === Object(query[key])
4303 ? this.addObjectQueryParam(query, key)
4304 : this.addQueryParam(query, key)
4305 )
4306 .join('&')
4307 }
4308
4309 protected addQueryParams(rawQuery?: QueryParamsType): string {
4310 const queryString = this.toQueryString(rawQuery)

Callers 3

addQueryParamsMethod · 0.95
HttpClientClass · 0.95
requestMethod · 0.95

Calls 4

addArrayQueryParamMethod · 0.95
addObjectQueryParamMethod · 0.95
addQueryParamMethod · 0.95
mapMethod · 0.80

Tested by

no test coverage detected