Updating logging to typescript to fix build issue.

This commit is contained in:
mike12345567 2022-07-06 14:04:04 +01:00
parent 85cb766d14
commit 3cc8b7d4a9
1 changed files with 6 additions and 2 deletions

View File

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