(collection: Collection<Node<unknown>>, node: Node<unknown>)
| 166 | } |
| 167 | |
| 168 | function getLastChild(collection: Collection<Node<unknown>>, node: Node<unknown>) { |
| 169 | if ('lastChildKey' in node) { |
| 170 | return node.lastChildKey != null ? collection.getItem(node.lastChildKey) : null; |
| 171 | } else { |
| 172 | return Array.from(node.childNodes).findLast(item => item.parentKey === node.key); |
| 173 | } |
| 174 | } |