MCPcopy
hub / github.com/alibaba/lowcode-engine / containsNode

Method containsNode

packages/designer/src/document/selection.ts:125–136  ·  view source on GitHub ↗

* 选区是否包含节点

(node: INode, excludeRoot = false)

Source from the content-addressed store, hash-verified

123 * 选区是否包含节点
124 */
125 containsNode(node: INode, excludeRoot = false) {
126 for (const id of this._selected) {
127 const parent = this.doc.getNode(id);
128 if (excludeRoot && parent?.contains(this.doc.focusNode)) {
129 continue;
130 }
131 if (parent?.contains(node)) {
132 return true;
133 }
134 }
135 return false;
136 }
137
138 /**
139 * 获取选中的节点

Callers

nothing calls this directly

Calls 2

getNodeMethod · 0.65
containsMethod · 0.65

Tested by

no test coverage detected