(target?: EventTarget | null)
| 23 | }; |
| 24 | |
| 25 | export const getOwnerWindow = (target?: EventTarget | null): Window & typeof globalThis => { |
| 26 | let ownerDocument = getOwnerDocument(target); |
| 27 | |
| 28 | // @ts-expect-error Ensure safe access in SSR environments. |
| 29 | return ownerDocument?.defaultView ?? (typeof window !== 'undefined' ? window : undefined); |
| 30 | }; |
| 31 | |
| 32 | /** |
| 33 | * Attaches an event listener on target(s) and returns a cleanup function. |
no test coverage detected