* Simple debug utility that only logs when debug mode is enabled * Set DEBUG to true in localStorage to enable debug logging
(...args: Array<unknown>)
| 457 | * Set DEBUG to true in localStorage to enable debug logging |
| 458 | */ |
| 459 | function debugLog(...args: Array<unknown>): void { |
| 460 | // Check if we're in a browser environment |
| 461 | const isBrowser = |
| 462 | typeof window !== `undefined` && typeof localStorage !== `undefined` |
| 463 | |
| 464 | // In browser, check localStorage for debug flag |
| 465 | if (isBrowser && localStorage.getItem(`DEBUG`) === `true`) { |
| 466 | console.log(`[proxy]`, ...args) |
| 467 | } |
| 468 | // In Node.js environment, check for environment variable (though this is primarily for browser) |
| 469 | else if ( |
| 470 | // true |
| 471 | !isBrowser && |
| 472 | typeof process !== `undefined` && |
| 473 | process.env.DEBUG === `true` |
| 474 | ) { |
| 475 | console.log(`[proxy]`, ...args) |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | // Add TypedArray interface with proper type |
| 480 | interface TypedArray { |
no test coverage detected
searching dependent graphs…