MCPcopy Create free account
hub / github.com/adobe/react-spectrum / isWindow

Function isWindow

packages/react-aria/src/utils/domHelpers.ts:48–50  ·  view source on GitHub ↗

* Type guard that checks if a value is a Window. Uses window self reference checks to * distinguish Window from other values.

(value: unknown)

Source from the content-addressed store, hash-verified

46 * distinguish Window from other values.
47 */
48function isWindow(value: unknown): value is Window & typeof globalThis {
49 return typeof value === 'object' && value != null && 'window' in value && value.window === value;
50}
51
52/**
53 * Type guard that checks if a value is a Document. Uses nodeType and host property checks to

Callers 1

getOwnerDocumentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected