elections-types 1.0.40 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { Candidate } from "./Candidate.js";
2
- import { Committee } from "./Committee.js";
1
+ import { CandidateAux } from "./Candidate.js";
2
+ import { CommitteeAux } from "./Committee.js";
3
3
  import { StateID } from "./State.js";
4
4
  declare const office_ids: readonly ["H", "S"];
5
5
  export type OfficeID = typeof office_ids[number];
@@ -18,9 +18,9 @@ export declare class Election {
18
18
  constructor(election: any);
19
19
  static is(election: any): election is Election;
20
20
  }
21
- export declare class ElectionAux extends Candidate {
22
- readonly candidates: Candidate[];
23
- readonly committees: Committee[];
21
+ export declare class ElectionAux extends Election {
22
+ readonly candidates: CandidateAux[];
23
+ readonly committees: CommitteeAux[];
24
24
  constructor(election: any);
25
25
  static is(election: any): election is ElectionAux;
26
26
  }
@@ -1,5 +1,5 @@
1
- import { Candidate } from "./Candidate.js";
2
- import { Committee } from "./Committee.js";
1
+ import { CandidateAux } from "./Candidate.js";
2
+ import { CommitteeAux } from "./Committee.js";
3
3
  import { is_state_id } from "./State.js";
4
4
  const office_ids = ["H", "S"];
5
5
  export function is_office_id(office_id) {
@@ -50,7 +50,7 @@ export class Election {
50
50
  (election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id) => typeof committee_id === "string")));
51
51
  }
52
52
  }
53
- export class ElectionAux extends Candidate {
53
+ export class ElectionAux extends Election {
54
54
  candidates;
55
55
  committees;
56
56
  constructor(election) {
@@ -64,8 +64,8 @@ export class ElectionAux extends Candidate {
64
64
  static is(election) {
65
65
  return (Election.is(election) &&
66
66
  Array.isArray(election.candidates) &&
67
- election.candidates.every(Candidate.is) &&
67
+ election.candidates.every(CandidateAux.is) &&
68
68
  Array.isArray(election.committees) &&
69
- election.committees.every(Committee.is));
69
+ election.committees.every(CommitteeAux.is));
70
70
  }
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -1,5 +1,5 @@
1
- import { Candidate } from "./Candidate"
2
- import { Committee } from "./Committee"
1
+ import { Candidate, CandidateAux } from "./Candidate"
2
+ import { Committee, CommitteeAux } from "./Committee"
3
3
  import { is_state_id, state_ids, StateID } from "./State"
4
4
 
5
5
  const office_ids = ["H", "S"] as const
@@ -67,9 +67,9 @@ export class Election {
67
67
  }
68
68
  }
69
69
 
70
- export class ElectionAux extends Candidate {
71
- readonly candidates : Candidate[]
72
- readonly committees : Committee[]
70
+ export class ElectionAux extends Election {
71
+ readonly candidates : CandidateAux[]
72
+ readonly committees : CommitteeAux[]
73
73
 
74
74
  constructor(election : any) {
75
75
  if (!ElectionAux.is(election)) {
@@ -84,9 +84,9 @@ export class ElectionAux extends Candidate {
84
84
  return (
85
85
  Election.is(election) &&
86
86
  Array.isArray(election.candidates) &&
87
- election.candidates.every(Candidate.is) &&
87
+ election.candidates.every(CandidateAux.is) &&
88
88
  Array.isArray(election.committees) &&
89
- election.committees.every(Committee.is)
89
+ election.committees.every(CommitteeAux.is)
90
90
  )
91
91
  }
92
92
  }