Return

All tests / src/helpers console.ts

36.36% Statements 4/11
0% Branches 0/4
25% Functions 1/4
30% Lines 3/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30          3x             1x                               3x  
/**
 * This is a wrapper for the console object.
 * It will only log to the console if the NODE_ENV is set to development.
 *
 */
const devConsole = {
    log: (...args: unknown[]) => {
        Iif (process.env.NODE_ENV === 'development') {
            globalThis.console.log(...args);
        }
    },
    error: (...args: unknown[]) => {
        Iif (process.env.NODE_ENV === 'development') {
            globalThis.console.error(...args);
        }
    },
    warn: (...args: unknown[]) => {
        Iif (process.env.NODE_ENV === 'development') {
            globalThis.console.warn(...args);
        }
    },
    info: (...args: unknown[]) => {
        Iif (process.env.NODE_ENV === 'development') {
            globalThis.console.info(...args);
        }
    },
};
 
export default devConsole;