UNPKG

@cdwr/core

Version:

A set of core utilities for the Codeware ecosystem.

21 lines (20 loc) 792 B
/** * Generic wrapper for Octokit calls. * * Operations that fail will throw an error indicating the issue. * But for requests that may not return an entity, like `get` requests, * can instead return `null` by setting `'not-found-returns-null'` option. * * @param operation Operation to perform * @returns Result of the operation * @throws If operation fails */ export declare function withGitHub<T>(operation: () => Promise<T>): Promise<T>; /** * Generic wrapper for Octokit calls. * * @param operation Operation to perform * @param option Request error handling option * @returns Result of the operation or `null` if a requested entity was not found */ export declare function withGitHub<T>(operation: () => Promise<T>, option: 'not-found-returns-null'): Promise<T | null>;