(path$$1, numStemmed)
| 1008 | // If any should be stemmed from the beginning of the array, that's passed |
| 1009 | // in as the second argument |
| 1010 | function pathToTree(path$$1, numStemmed) { |
| 1011 | var root; |
| 1012 | var leaf; |
| 1013 | for (var i = numStemmed, len = path$$1.length; i < len; i++) { |
| 1014 | var node = path$$1[i]; |
| 1015 | var currentLeaf = [node.id, node.opts, []]; |
| 1016 | if (leaf) { |
| 1017 | leaf[2].push(currentLeaf); |
| 1018 | leaf = currentLeaf; |
| 1019 | } else { |
| 1020 | root = leaf = currentLeaf; |
| 1021 | } |
| 1022 | } |
| 1023 | return root; |
| 1024 | } |
| 1025 | |
| 1026 | // compare the IDs of two trees |
| 1027 | function compareTree(a, b) { |
no outgoing calls
no test coverage detected
searching dependent graphs…