mirror of https://github.com/Budibase/budibase.git
2 changed files with 26 additions and 2 deletions
@ -0,0 +1,16 @@ |
|||||
|
export const suppressWarnings = warnings => { |
||||
|
if (!warnings?.length) { |
||||
|
return |
||||
|
} |
||||
|
const regex = new RegExp(warnings.map(x => `(${x})`).join("|"), "gi") |
||||
|
const warn = console.warn |
||||
|
console.warn = (...params) => { |
||||
|
const msg = params[0] |
||||
|
if (msg && typeof msg === "string") { |
||||
|
if (msg.match(regex)) { |
||||
|
return |
||||
|
} |
||||
|
} |
||||
|
warn(...params) |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue