MCPcopy Create free account
hub / github.com/dfinity/orbit / unwrapOk

Function unwrapOk

cli/src/audit/station.core.ts:19–24  ·  view source on GitHub ↗
(response: unknown, method: string)

Source from the content-addressed store, hash-verified

17}
18
19const 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
26const nextOffset = (next_offset: Array<bigint> | []): bigint | null =>
27 next_offset.length > 0 ? next_offset[0] : null;

Callers 1

paginatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected