True when the raw params schema uses `anyOf: [{ not: {} }, …]` — Zod's pattern for `.optional()`.
(method: RpcMethod)
| 429 | |
| 430 | /** True when the raw params schema uses `anyOf: [{ not: {} }, …]` — Zod's pattern for `.optional()`. */ |
| 431 | function isParamsOptional(method: RpcMethod): boolean { |
| 432 | const schema = method.params; |
| 433 | if (!schema?.anyOf) return false; |
| 434 | return schema.anyOf.some( |
| 435 | (item) => |
| 436 | typeof item === "object" && |
| 437 | (item as JSONSchema7).not !== undefined && |
| 438 | typeof (item as JSONSchema7).not === "object" && |
| 439 | Object.keys((item as JSONSchema7).not as object).length === 0 |
| 440 | ); |
| 441 | } |
| 442 | |
| 443 | function resultTypeName(method: RpcMethod): string { |
| 444 | const schema = getMethodResultSchema(method); |
no outgoing calls
no test coverage detected
searching dependent graphs…