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

Function isNode

packages/react-aria/src/utils/domHelpers.ts:35–42  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

33 * property.
34 */
35export function isNode(value: unknown): value is Node {
36 return (
37 value !== null &&
38 typeof value === 'object' &&
39 'nodeType' in value &&
40 typeof value.nodeType === 'number'
41 );
42}
43
44/**
45 * Type guard that checks if a value is a Window. Uses window self reference checks to

Callers 2

isDocumentFunction · 0.85
isShadowRootFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected