votes
    Preparing search index...

    Function normalizeBallots

    • Keeps only candidates in each ballot, each at its first rank. With appendUnranked (default true), a ballot that ranks anyone also ranks the rest, tied last.

      Type Parameters

      • C extends string
      • B extends Ballot<C>

      Parameters

      • ballots: readonly B[]
      • candidates: readonly C[]
      • appendUnranked: boolean = true

      Returns B[]