Updating logging to typescript to fix build issue.

This commit is contained in:
mike12345567 2022-07-06 14:04:04 +01:00
parent fee6ca4cfb
commit 35ed1baeca
1 changed files with 6 additions and 2 deletions

View File

@ -1,10 +1,10 @@
const NonErrors = ["AccountError"]
function isSuppressed(e) {
function isSuppressed(e?: any) {
return e && e["suppressAlert"]
}
module.exports.logAlert = (message, e = null) => {
export function logAlert(message: string, e?: any) {
if (e && NonErrors.includes(e.name) && isSuppressed(e)) {
return
}
@ -14,3 +14,7 @@ module.exports.logAlert = (message, e = null) => {
}
console.error(`bb-alert: ${message} ${errorJson}`)
}
export default {
logAlert,
}