/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/ban-types */ // eslint-disable-next-line @typescript-eslint/no-empty-function export const noop = () => {}; export function on( obj: T | null, ...args: Parameters | [string, Function | null, ...any] ): void { if (obj && obj.addEventListener) { obj.addEventListener( ...(args as Parameters), ); } } export function off( obj: T | null, ...args: | Parameters | [string, Function | null, ...any] ): void { if (obj && obj.removeEventListener) { obj.removeEventListener( ...(args as Parameters), ); } } export const isBrowser = typeof window !== 'undefined'; export const isNavigator = typeof navigator !== 'undefined';