import { debug as d } from '@hint/utils-debug'; const debug: debug.IDebugger = d(__filename); /** Wrap an async function, returning null if the evaluation throws and exception. */ export const asyncTry = (asyncFn: (...args: any[]) => Promise) => { return async (...args: any[]): Promise => { try { return await asyncFn(...args); } catch (err) { debug(err); return null; } }; };