MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / withQuery

Function withQuery

web/src/app/api/v1/gravity-index/_post.ts:42–52  ·  view source on GitHub ↗
(
  path: string,
  params: Record<string, string | undefined>,
)

Source from the content-addressed store, hash-verified

40) => (gravityApiKey ? text.split(gravityApiKey).join('[redacted]') : text)
41
42const withQuery = (
43 path: string,
44 params: Record<string, string | undefined>,
45) => {
46 const qs = new URLSearchParams()
47 for (const [key, value] of Object.entries(params)) {
48 if (value) qs.set(key, value)
49 }
50 const query = qs.toString()
51 return query ? `${path}?${query}` : path
52}
53
54const requireGravityApiKey = (gravityApiKey: string | undefined) => {
55 if (!gravityApiKey) {

Callers 1

buildGravityIndexRequestFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected