Created
February 23, 2024 18:27
-
-
Save valterbarros/bb059d95a46dd4fae2840f78435ad4fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// setupFiles.ts | |
const { warn, log } = console; | |
const fnOverride = (callback: Function, ...msg: Array<[]>) => { | |
// if (!Object.getPrototypeOf(msg[0])) return callback(...msg); | |
const shouldIgnore = !!msg.find((m) => /Vue|mountOptions|FetchError/gi.test(String(m))); | |
if (!shouldIgnore) callback(...msg); | |
} | |
console.warn = (...args) => fnOverride(warn, ...args); | |
console.log = (...args) => fnOverride(log, ...args); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment