
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
highest-averages
Advanced tools
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
Zero-dependency and extensible set of highest averages methods for allocating seats in a parliament.
npm i highest-averages
const a = new Candidate('A', 200)
const b = new Candidate('B', 140)
const c = new Candidate('C', 70)
const divisor: Divisor = new class implements Divisor {
next (iteration: number): number {
return iteration + 2
}
}
const highestAverage = new HighestAverage(divisor)
const result = highestAverage
.withSeat(5)
.withCandidates([a, b, c])
.apply()
result.forEach(candidate => console.log(`${candidate.name()}:${candidate.seat}`))
A:3
B:2
C:0
| 1 | 2 | 3 | 4 | 5 | Result | |
|---|---|---|---|---|---|---|
| A | 100* | 66.66 | 66.66* | 50* | 40 | 3 |
| B | 70 | 70* | 46.66 | 46.66 | 46.66* | 2 |
| C | 35 | 35 | 35 | 35 | 35 | 0 |
const result = new DHondt()
.withSeat(5)
.withCandidates([])
.apply()
const result = new SainteLague()
.withSeat(5)
.withCandidates([])
.apply()
const result = new Imperiali()
.withSeat(5)
.withCandidates([])
.apply()
const result = new HuntingtonHill()
.withSeat(5)
.withCandidates([])
.apply()
const result = new Danish()
.withSeat(5)
.withCandidates([])
.apply()
FAQs
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
We found that highest-averages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.