UNPKG

ecclesia

Version:

Framework for political and electoral simulations

33 lines (32 loc) 811 B
// src/election/ballots.ts var Scores; ((Scores2) => { function get(key) { const value = this.get(key); if (value === void 0) { return Array(this.ngrades).fill(0); } return value; } function fromEntries(elements) { if (elements.length === 0) { throw new Error("Use the fromGrades method to create an empty Scores instance"); } const ths = new Map(elements); ths.ngrades = elements[0][1].length; ths.get = get.bind(ths); return ths; } Scores2.fromEntries = fromEntries; function fromGrades(ngrades) { const ths = /* @__PURE__ */ new Map(); ths.ngrades = ngrades; ths.get = get.bind(ths); return ths; } Scores2.fromGrades = fromGrades; })(Scores || (Scores = {})); export { Scores }; //# sourceMappingURL=chunk-W6BKA6NW.js.map