@tanstack/db
Version:
A reactive client store for building super fast apps on sync
22 lines (21 loc) • 799 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const ir = require("../ir.cjs");
function findAggregate(value) {
if (value === null || typeof value !== `object`) return void 0;
if (Array.isArray(value)) {
for (const item of value) {
const aggregate = findAggregate(item);
if (aggregate) return aggregate;
}
return void 0;
}
if (value instanceof ir.Aggregate) return value;
if (value instanceof ir.Func) return findAggregate(value.args);
if (value instanceof ir.ConditionalSelect)
return findAggregate([value.branches, value.defaultValue]);
if (ir.isExpressionLike(value)) return void 0;
return findAggregate(Object.values(value));
}
exports.findAggregate = findAggregate;
//# sourceMappingURL=find-aggregate.cjs.map