( el: (Window & typeof globalThis) | Element | null | undefined )
| 3 | }; |
| 4 | |
| 5 | export const getOwnerWindow = ( |
| 6 | el: (Window & typeof globalThis) | Element | null | undefined |
| 7 | ): Window & typeof globalThis => { |
| 8 | if (el && 'window' in el && el.window === el) { |
| 9 | return el; |
| 10 | } |
| 11 | |
| 12 | const doc = getOwnerDocument(el as Element | null | undefined); |
| 13 | return doc.defaultView || window; |
| 14 | }; |
| 15 | |
| 16 | /** |
| 17 | * Type guard that checks if a value is a Node. Verifies the presence and type of the nodeType |
no test coverage detected