MCPcopy Create free account
hub / github.com/TanStack/hotkeys / getTargetLabel

Function getTargetLabel

packages/hotkeys-devtools/src/components/HotkeyList.tsx:23–34  ·  view source on GitHub ↗
(target: HTMLElement | Document | Window)

Source from the content-addressed store, hash-verified

21}
22
23function getTargetLabel(target: HTMLElement | Document | Window): string {
24 if (typeof document !== 'undefined' && target === document) {
25 return 'document'
26 }
27 if (typeof window !== 'undefined' && target === window) {
28 return 'window'
29 }
30 if (target instanceof HTMLElement) {
31 return target.tagName.toLowerCase()
32 }
33 return 'element'
34}
35
36function getTargetTooltip(target: HTMLElement | Document | Window): string {
37 if (typeof document !== 'undefined' && target === document) {

Callers 2

SequenceListRowFunction · 0.85
HotkeyListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…