MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / getLeafNode

Function getLeafNode

code/composition/public/app.js:6415–6420  ·  view source on GitHub ↗

* Given any node return the first leaf node without children. * * @param {DOMElement|DOMTextNode} node * @return {DOMElement|DOMTextNode}

(node)

Source from the content-addressed store, hash-verified

6413 * @return {DOMElement|DOMTextNode}
6414 */
6415function getLeafNode(node) {
6416 while (node && node.firstChild) {
6417 node = node.firstChild;
6418 }
6419 return node;
6420}
6421
6422/**
6423 * Get the next sibling within a container. This will walk up the

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected