MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / ensureNode

Function ensureNode

packages/designer/src/document/node/node.ts:1372–1384  ·  view source on GitHub ↗
(node: any, document: IDocumentModel)

Source from the content-addressed store, hash-verified

1370}
1371
1372function ensureNode(node: any, document: IDocumentModel): INode {
1373 let nodeInstance = node;
1374 if (!isNode(node)) {
1375 if (node.getComponentName) {
1376 nodeInstance = document.createNode({
1377 componentName: node.getComponentName(),
1378 });
1379 } else {
1380 nodeInstance = document.createNode(node);
1381 }
1382 }
1383 return nodeInstance;
1384}
1385
1386export interface LeafNode extends Node {
1387 readonly children: null;

Callers 2

insertBeforeMethod · 0.85
insertAfterMethod · 0.85

Calls 3

isNodeFunction · 0.85
getComponentNameMethod · 0.80
createNodeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…