10 lines
368 B
TypeScript
10 lines
368 B
TypeScript
export function consoleDebug(...args: unknown[]): void {
|
|
const isDebugEnabled = localStorage.getItem('debug') === 'true';
|
|
const isLocalhost = window.location.hostname === 'localhost';
|
|
const isTestDomain = window.location.hostname.includes('.test');
|
|
|
|
if (isDebugEnabled || isLocalhost || isTestDomain) {
|
|
console.log('[DEBUG]', ...args);
|
|
}
|
|
}
|