MCPcopy Index your code
hub / github.com/anomalyco/opencode / part

Function part

packages/httpapi-codegen/src/index.ts:509–514  ·  view source on GitHub ↗
(source: InputField["source"])

Source from the content-addressed store, hash-verified

507 const access = (name: string) =>
508 `input${endpoint.operation.inputMode === "optional" ? "?." : ""}[${JSON.stringify(name)}]`
509 const part = (source: InputField["source"]) => {
510 const inputs = endpoint.input.filter((field) => field.source === source)
511 return inputs.length === 0
512 ? undefined
513 : `{ ${inputs.map((field) => `${JSON.stringify(field.name)}: ${access(field.name)}`).join(", ")} }`
514 }
515 const parts = [
516 endpoint.query === undefined ? undefined : `query: ${part("query")}`,
517 endpoint.headers === undefined ? undefined : `headers: ${part("headers")}`,

Callers 1

renderPromiseClientFunction · 0.70

Calls 1

accessFunction · 0.70

Tested by

no test coverage detected