@szegedsw/lib-node
Version:
A little framework published by Szeged Software Zrt. in order to enhance api endpoint security and create reuseable code. Email module, Logging system, and much more. Further improvements are expected.
13 lines • 563 B
TypeScript
import { Response } from "express";
import { HttpCodes } from "../config/http-codes";
export interface IErrors {
[message: string]: {
code: keyof typeof HttpCodes;
body: string;
override?: string;
onError?: () => Promise<void>;
};
}
export declare type OnError = (message: string, variables?: string[]) => Promise<void>;
export declare function _try<T>(res: Response | undefined, tryFunction: () => Promise<T>, errors?: IErrors, onError?: OnError, splitter?: string): Promise<T | boolean>;
//# sourceMappingURL=try.d.ts.map