UNPKG

@tanstack/table-core

Version:

Headless UI for building powerful tables & datagrids for TS/JS.

13 lines (11 loc) 415 B
export function safelyAccessDocument(_document?: Document): Document | null { return _document || (typeof document !== 'undefined' ? document : null) } export function safelyAccessDocumentEvent(event: Event): Document | null { return !!event && !!event.target && typeof event.target === 'object' && 'ownerDocument' in event.target ? (event.target.ownerDocument as Document | null) : null }