@pogodisco/response 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/utils/response.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare function isFailure<T>(resp: TResponse<T>): resp is FailureRespons
|
|
|
5
5
|
export declare function isSuccess<T>(resp: TResponse<T>): resp is SuccessResponse<T>;
|
|
6
6
|
export declare function assertResponse<T>(res: TResponse<T>, msg?: string): T;
|
|
7
7
|
export declare function withResponse<Args extends any[], Return>(fn: (...args: Args) => Promise<Return> | Return, validate?: (result: Return) => boolean, failureMessage?: string): (...args: Args) => Promise<TResponse<Return>>;
|
|
8
|
+
export declare function toResponse<T, A extends any[] = []>(fn: (...args: A) => Promise<any>, ...args: A): Promise<TResponse<T>>;
|
package/dist/utils/response.js
CHANGED