ignore-errors
Version:
Easily ignore specific promise errors
13 lines (12 loc) • 780 B
TypeScript
declare type LiteralMatchType = any;
declare type MatchType = Record<any, LiteralMatchType> | Map<any, LiteralMatchType>;
declare type ArgsType = [MatchType] | [string, LiteralMatchType];
declare type IgnoreFnType = (val: any) => null;
export default function ignore(...args: ArgsType): IgnoreFnType;
export declare const ignoreMessage: (val: LiteralMatchType) => IgnoreFnType;
export declare const ignoreName: (val: LiteralMatchType) => IgnoreFnType;
export declare const ignoreStatus: (val: LiteralMatchType) => IgnoreFnType;
export declare const ignoreReason: (val: LiteralMatchType) => IgnoreFnType;
export declare const ignoreCode: (val: LiteralMatchType) => IgnoreFnType;
export declare const ignoreAny: (...ignoreFns: Array<IgnoreFnType>) => (err: any) => null;
export {};