MCPcopy Create free account
hub / github.com/angular/components / getEventView

Function getEventView

src/cdk/testing/testbed/fake-events/event-objects.ts:170–177  ·  view source on GitHub ↗

Gets the `view` that should be passed to synthetically-created DOM events

()

Source from the content-addressed store, hash-verified

168
169/** Gets the `view` that should be passed to synthetically-created DOM events */
170function 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}

Callers 3

createMouseEventFunction · 0.85
createPointerEventFunction · 0.85
createKeyboardEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected