MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / optionalTextParam

Function optionalTextParam

src/ui-server/api/respond.ts:196–200  ·  view source on GitHub ↗
(query: URLSearchParams, name: string)

Source from the content-addressed store, hash-verified

194 * cleared. Absent is still an error; empty is a legitimate state.
195 */
196export function optionalTextParam(query: URLSearchParams, name: string): string {
197 const raw = query.get(name);
198 if (raw === null) throw badRequest(`Missing required parameter "${name}".`);
199 return boundLength(raw, name);
200}
201
202function boundLength(raw: string, name: string): string {
203 if (raw.length > MAX_QUERY_LENGTH) {

Callers 1

buildSearchFunction · 0.90

Calls 3

badRequestFunction · 0.85
boundLengthFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected