MCPcopy Create free account
hub / github.com/editablejs/editable / isDOMSelection

Function isDOMSelection

packages/models/src/utils/dom.ts:64–67  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

62 */
63
64export const isDOMSelection = (value: any): value is DOMSelection => {
65 const window = value && value.anchorNode && getDefaultView(value.anchorNode)
66 return !!window && value instanceof window.Selection
67}
68
69/**
70 * Check if a DOM node is an element node.

Callers 1

toEditorRangeFunction · 0.90

Calls 1

getDefaultViewFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…