Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reuters-graphics/electoral-college-permutations

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reuters-graphics/electoral-college-permutations

[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Felectoral-college-permutations.svg)](https://badge.fury.io/js/%40reuters-graphics%2Felectoral-college-permutations) [![Reuters open source software](https://badgen.net/badge/Reuters/open%20sou

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

@reuters-graphics/electoral-college-permutations

npm version Reuters open source software

Quickstart

$ yarn add @reuters-graphics/electoral-college-permutations
import Election2020Scenarios from '@reuters-graphics/electoral-college-permutations';

const outstandingStates = {
  WI: 10,
  MI: 16,
  GA: 16,
  PA: 20,
  NC: 15,
  AZ: 11,
  NV: 6,
  AK: 3,
};
const candidateElectoralVotes = {
  R: 213,
  D: 227,
};

const election2020Scenarios = new Election2020Scenarios(candidateElectoralVotes, outstandingStates);

const scenarios = election2020Scenarios.call('MI', 'D');

// {
//  states: ['WI', 'MI', ...],
//  scenariosByWinner: {
//    R: [
//      {
//         scenario: ['R', 'D', ...],
//         result: { R: 220, D: 230 },
//      },
//      ...
//    ],
//    D: [ {}, ...],
//    Tie: [{}, ...],
//  }
// }

Testing

$ yarn test

FAQs

Package last updated on 04 Nov 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc