MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / insertChildren

Function insertChildren

packages/core/src/document/node/node.ts:870–885  ·  view source on GitHub ↗
(
  container: Node,
  nodes: Node[] | NodeSchema[],
  at?: number | null,
  copy?: boolean,
)

Source from the content-addressed store, hash-verified

868}
869
870export const insertChildren = (
871 container: Node,
872 nodes: Node[] | NodeSchema[],
873 at?: number | null,
874 copy?: boolean,
875): Node[] => {
876 let index = at
877 let node: any
878 const results: Node[] = []
879 while ((node = nodes.pop())) {
880 node = insertChild(container, node, index, copy)
881 results.push(node)
882 index = node.index
883 }
884 return results
885}
886
887/**
888 * get the closest node that satisfies the condition

Callers 5

insertNodesMethod · 0.90
constructorMethod · 0.90
onClickFunction · 0.90
initFunction · 0.90
onClickFunction · 0.90

Calls 1

insertChildFunction · 0.85

Tested by

no test coverage detected