(res: ServerResponse, payload: unknown, method: string)
| 61 | |
| 62 | /** Send a successful payload. */ |
| 63 | export function ok(res: ServerResponse, payload: unknown, method: string): true { |
| 64 | sendJson(res, 200, payload, method); |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | /** Send a failure. Anything that is not an {@link ApiError} becomes a 500. */ |
| 69 | export function fail(res: ServerResponse, err: unknown, method: string): true { |
no test coverage detected