()
| 13149 | } |
| 13150 | |
| 13151 | function* node_iterator() { |
| 13152 | var node = this, current, next = [node], children, i, n; |
| 13153 | do { |
| 13154 | current = next.reverse(), next = []; |
| 13155 | while (node = current.pop()) { |
| 13156 | yield node; |
| 13157 | if (children = node.children) { |
| 13158 | for (i = 0, n = children.length; i < n; ++i) { |
| 13159 | next.push(children[i]); |
| 13160 | } |
| 13161 | } |
| 13162 | } |
| 13163 | } while (next.length); |
| 13164 | } |
| 13165 | |
| 13166 | function hierarchy(data, children) { |
| 13167 | if (data instanceof Map) { |