UNPKG

tsplot

Version:

A CLI and tooling library to plot Typescript project information to different template targets.

22 lines 728 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.entriesToObject = exports.groupSums = void 0; /** * Accumulates the sums of key occurrences. Shall be used with {@link Array.prototype.reduce} * @internal */ const groupSums = (acc, key) => { var _a; acc[key] = ((_a = acc[key]) !== null && _a !== void 0 ? _a : 0) + 1; return acc; }; exports.groupSums = groupSums; /** * Accumulates an object from entries. Shall be used with {@link Array.prototype.reduce} * @internal */ const entriesToObject = (acc, [key, value]) => { return Object.assign(Object.assign({}, acc), { [key]: value }); }; exports.entriesToObject = entriesToObject; //# sourceMappingURL=accumulators.js.map