MCPcopy Create free account
hub / github.com/Martian-Engineering/pr-sheriff / encodeQuery

Function encodeQuery

src/github/github_fetch.mjs:14–22  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

12}
13
14function encodeQuery(params) {
15 const usp = new URLSearchParams();
16 for (const [k, v] of Object.entries(params || {})) {
17 if (v === undefined || v === null) continue;
18 usp.set(k, String(v));
19 }
20 const qs = usp.toString();
21 return qs ? `?${qs}` : '';
22}
23
24function splitHttpResponse(raw) {
25 // `gh api --include` uses LF line endings on macOS, but handle CRLF too.

Callers 3

#restPaginateArrayMethod · 0.85
#restPaginateSearchMethod · 0.85
#restRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected