Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}),
prev = this._internal || [], curr = [], i, n;
function level(index, node, values) {
var vals = aggrs[index].execute(values);
node[childField] = vals;
vals.forEach(function(n) {
n[parentField] = node;
curr.push(Tuple.ingest(n));
if (index+1 < fields.length) level(index+1, n, n[childField]);
else n[childField].forEach(function(c) { c[parentField] = n; });
});
}
var root = Tuple.ingest({});
root[parentField] = null;
curr.push(root);
level(0, root, data);
// update changeset with internal nodes
for (i=0, n=curr.length; i
vals.forEach(function(n) {
n[parentField] = node;
curr.push(Tuple.ingest(n));
if (index+1 < fields.length) level(index+1, n, n[childField]);
else n[childField].forEach(function(c) { c[parentField] = n; });
});
}
function tuple(gb, gv, ob, ov) {
var t = {_imputed: true}, i;
for (i=0; i