( container: INode, thing: INode | IPublicTypeNodeData, at?: number | null, copy?: boolean, )
| 1479 | } |
| 1480 | |
| 1481 | export function insertChild( |
| 1482 | container: INode, |
| 1483 | thing: INode | IPublicTypeNodeData, |
| 1484 | at?: number | null, |
| 1485 | copy?: boolean, |
| 1486 | ): INode | null { |
| 1487 | let node: INode | null | IRootNode | undefined; |
| 1488 | let nodeSchema: IPublicTypeNodeSchema; |
| 1489 | if (isNode<INode>(thing) && (copy || thing.isSlot())) { |
| 1490 | nodeSchema = thing.export(IPublicEnumTransformStage.Clone); |
| 1491 | node = container.document?.createNode(nodeSchema); |
| 1492 | } else if (isNode<INode>(thing)) { |
| 1493 | node = thing; |
| 1494 | } else if (isNodeSchema(thing)) { |
| 1495 | node = container.document?.createNode(thing); |
| 1496 | } |
| 1497 | |
| 1498 | if (isNode<INode>(node)) { |
| 1499 | container.children?.insert(node, at); |
| 1500 | return node; |
| 1501 | } |
| 1502 | |
| 1503 | return null; |
| 1504 | } |
| 1505 | |
| 1506 | export function insertChildren( |
| 1507 | container: INode, |
no test coverage detected
searching dependent graphs…