(scope, ds, name, optype, field, counts, index)
| 135645 | } |
| 135646 | |
| 135647 | function cache(scope, ds, name, optype, field, counts, index) { |
| 135648 | var cache = ds[name] || (ds[name] = {}), |
| 135649 | sort = (0, _util.sortKey)(counts), |
| 135650 | k = fieldKey(field), |
| 135651 | v, |
| 135652 | op; |
| 135653 | |
| 135654 | if (k != null) { |
| 135655 | scope = ds.scope; |
| 135656 | k = k + (sort ? '|' + sort : ''); |
| 135657 | v = cache[k]; |
| 135658 | } |
| 135659 | |
| 135660 | if (!v) { |
| 135661 | var params = counts ? { |
| 135662 | field: _util.keyFieldRef, |
| 135663 | pulse: ds.countsRef(scope, field, counts) |
| 135664 | } : { |
| 135665 | field: scope.fieldRef(field), |
| 135666 | pulse: (0, _util.ref)(ds.output) |
| 135667 | }; |
| 135668 | if (sort) params.sort = scope.sortRef(counts); |
| 135669 | op = scope.add((0, _util.entry)(optype, undefined, params)); |
| 135670 | if (index) ds.index[field] = op; |
| 135671 | v = (0, _util.ref)(op); |
| 135672 | if (k != null) cache[k] = v; |
| 135673 | } |
| 135674 | |
| 135675 | return v; |
| 135676 | } |
| 135677 | |
| 135678 | prototype.tuplesRef = function () { |
| 135679 | return (0, _util.ref)(this.values); |
no test coverage detected