Gets the `view` that should be passed to synthetically-created DOM events
()
| 168 | |
| 169 | /** Gets the `view` that should be passed to synthetically-created DOM events */ |
| 170 | function getEventView(): Window | undefined { |
| 171 | // Passing `window` as the `view` on for events when the environment is using jsdom |
| 172 | // ends up throwing `member view is not of type Window` (see #32389). Leave it as |
| 173 | // `undefined` for such cases. |
| 174 | return typeof window !== 'undefined' && window && !(window as Window & {jsdom?: unknown}).jsdom |
| 175 | ? window |
| 176 | : undefined; |
| 177 | } |
no outgoing calls
no test coverage detected