|
Last change
on this file since ba17441 was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
264 bytes
|
| Rev | Line | |
|---|
| [e4c61dd] | 1 | export default function(value) {
|
|---|
| 2 | return this.eachAfter(function(node) {
|
|---|
| 3 | var sum = +value(node.data) || 0,
|
|---|
| 4 | children = node.children,
|
|---|
| 5 | i = children && children.length;
|
|---|
| 6 | while (--i >= 0) sum += children[i].value;
|
|---|
| 7 | node.value = sum;
|
|---|
| 8 | });
|
|---|
| 9 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.