Function
unwrapOk
(response: unknown, method: string)
Source from the content-addressed store, hash-verified
| 17 | } |
| 18 | |
| 19 | const unwrapOk = <T>(response: unknown, method: string): T => { |
| 20 | if (response && typeof response === 'object' && 'Ok' in response) { |
| 21 | return (response as OkOf<T>).Ok; |
| 22 | } |
| 23 | throw new Error(`Station call '${method}' failed: ${JSON.stringify(response)}`); |
| 24 | }; |
| 25 | |
| 26 | const nextOffset = (next_offset: Array<bigint> | []): bigint | null => |
| 27 | next_offset.length > 0 ? next_offset[0] : null; |
Tested by
no test coverage detected