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

Function isDocument

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

Source from the content-addressed store, hash-verified

54 * distinguish Document from other values.
55 */
56export function isDocument(value: unknown): value is Document {
57 return isNode(value) && value.nodeType === 9;
58}
59
60/**
61 * Type guard that checks if a value is a ShadowRoot. Uses nodeType and host property checks to

Callers 1

getOwnerDocumentFunction · 0.70

Calls 1

isNodeFunction · 0.85

Tested by

no test coverage detected