Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
// Merge grouping bindings and aggregator bindings
return groupBindings.merge(aggBindings);
});
// Case: No Input
// Some aggregators still define an output on the empty input
// Result is a single Bindings
if (rows.length === 0) {
const single: { [key: string]: Term } = {};
for (const i in this.pattern.aggregates) {
const aggregate = this.pattern.aggregates[i];
const key = termToString(aggregate.variable);
const value = AggregateEvaluator.emptyValue(aggregate);
if (value !== undefined) {
single[key] = value;
}
}
rows = [Bindings(single)];
}
return rows;
}