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

Function getLeafNode

code/new-context-api/public/app.js:5638–5643  ·  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

5636 * @return {DOMElement|DOMTextNode}
5637 */
5638function getLeafNode(node) {
5639 while (node && node.firstChild) {
5640 node = node.firstChild;
5641 }
5642 return node;
5643}
5644
5645/**
5646 * Get the next sibling within a container. This will walk up the

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected