(source: InputField["source"])
| 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")}`, |
no test coverage detected