()
| 62 | let enabledCache: boolean | null = null; |
| 63 | |
| 64 | export function isTraceEnabled(): boolean { |
| 65 | if (enabledCache !== null) return enabledCache; |
| 66 | let enabled = false; |
| 67 | try { |
| 68 | if (typeof location !== 'undefined') { |
| 69 | const v = new URLSearchParams(location.search).get('debug'); |
| 70 | if (v === '1' || v === 'true') enabled = true; |
| 71 | } |
| 72 | } catch { |
| 73 | // location unavailable |
| 74 | } |
| 75 | if (!enabled) { |
| 76 | enabled = safeGetString(STORAGE_KEYS.debug) === '1'; |
| 77 | } |
| 78 | enabledCache = enabled; |
| 79 | return enabled; |
| 80 | } |
| 81 | |
| 82 | // --------------------------------------------------------------------------- |
| 83 | // Ring buffer + reactivity |
no test coverage detected