const loggedErrors = new WeakSet < any > ( ) ; export function markErrorLogged < T = any > ( error ) { loggedErrors . add ( error ) ; return error ; } export function isErrorLogged ( error ) { return loggedErrors . has ( error ) ; }