( endpoint: string, method: string, pathName: string, body?: unknown, )
| 904 | } |
| 905 | |
| 906 | function requestJson<T = unknown>( |
| 907 | endpoint: string, |
| 908 | method: string, |
| 909 | pathName: string, |
| 910 | body?: unknown, |
| 911 | ): Promise<T> { |
| 912 | return requestBuffer(endpoint, pathName, method, body).then((buffer) => |
| 913 | JSON.parse(buffer.toString("utf8")), |
| 914 | ); |
| 915 | } |
| 916 | |
| 917 | function requestBuffer( |
| 918 | endpoint: string, |
no test coverage detected