UNPKG

highest-averages

Version:

Zero-dependency and extensible set of highest averages methods for allocating seats in a parliament. ### Install ```shell npm i highest-averages ``` ### Pure Example - Define the candidates with their vote ```typescript const a = new Candidate('A', 200) c

21 lines (20 loc) 657 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Greenland2021 = exports.Greenland2018 = void 0; const dhondt_1 = require("../dhondt"); // https://en.wikipedia.org/wiki/2018_Greenlandic_general_election class Greenland2018 { dhondt = (new dhondt_1.DHondt); seat = 31; apply(candidates) { return this.dhondt .withSeat(this.seat) .withCandidates(candidates) .apply(); } } exports.Greenland2018 = Greenland2018; // https://en.wikipedia.org/wiki/2021_Greenlandic_general_election class Greenland2021 extends Greenland2018 { } exports.Greenland2021 = Greenland2021;