elections-types 1.0.67 → 1.0.69

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,6 +1,5 @@
1
1
  import { CommitteeAux } from "./Committee.js";
2
2
  import { ElectionID, OfficeID } from "./Election.js";
3
- import { FECF3File } from "./FECF3File.js";
4
3
  import { StateID } from "./State.js";
5
4
  export declare class ActivityIndex {
6
5
  readonly news_index: number;
@@ -31,7 +30,6 @@ export declare class Candidate {
31
30
  }
32
31
  export declare class CandidateAux extends Candidate {
33
32
  readonly committees: CommitteeAux[];
34
- readonly fec_f3_files: FECF3File[];
35
33
  constructor(candidate: any);
36
34
  static is(candidate: any): candidate is CandidateAux;
37
35
  }
@@ -1,6 +1,5 @@
1
1
  import { CommitteeAux } from "./Committee.js";
2
2
  import { is_election_id, is_office_id } from "./Election.js";
3
- import { FECF3File } from "./FECF3File.js";
4
3
  import { is_state_id } from "./State.js";
5
4
  export class ActivityIndex {
6
5
  news_index;
@@ -78,20 +77,18 @@ export class Candidate {
78
77
  }
79
78
  export class CandidateAux extends Candidate {
80
79
  committees;
81
- fec_f3_files;
80
+ // readonly fec_f3_files : FECF3File[]
82
81
  constructor(candidate) {
83
82
  if (!CandidateAux.is(candidate)) {
84
83
  throw Error("Invalid input.");
85
84
  }
86
85
  super(candidate);
87
86
  this.committees = candidate.committees;
88
- this.fec_f3_files = candidate.fec_f3_files.map(fec_f3_file => new FECF3File(fec_f3_file));
87
+ // this.fec_f3_files = candidate.fec_f3_files.map(fec_f3_file => new FECF3File(fec_f3_file))
89
88
  }
90
89
  static is(candidate) {
91
90
  return (Candidate.is(candidate) &&
92
91
  Array.isArray(candidate.committees) &&
93
- candidate.committees.every(CommitteeAux.is) &&
94
- Array.isArray(candidate.fec_f3_files) &&
95
- candidate.fec_f3_files.every(FECF3File.is));
92
+ candidate.committees.every(CommitteeAux.is));
96
93
  }
97
94
  }
@@ -12,7 +12,6 @@ export declare class Election {
12
12
  readonly office_id: OfficeID;
13
13
  readonly state_id: StateID;
14
14
  readonly district?: number;
15
- readonly committee_ids?: string[];
16
15
  readonly [x: string]: any;
17
16
  constructor(election: Election);
18
17
  static is(election: any): election is Election;
@@ -25,7 +25,6 @@ export class Election {
25
25
  office_id;
26
26
  state_id;
27
27
  district;
28
- committee_ids;
29
28
  constructor(election) {
30
29
  if (!Election.is(election)) {
31
30
  throw Error("Invalid input.");
@@ -35,7 +34,6 @@ export class Election {
35
34
  this.office_id = election.office_id;
36
35
  this.state_id = election.state_id;
37
36
  this.district = election.district;
38
- this.committee_ids = election.committee_ids;
39
37
  }
40
38
  static is(election) {
41
39
  return (election !== undefined &&
@@ -43,8 +41,7 @@ export class Election {
43
41
  typeof election.name === "string" &&
44
42
  is_office_id(election.office_id) &&
45
43
  is_state_id(election.state_id) &&
46
- (election.district === undefined || typeof election.district === "number") &&
47
- (election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id) => typeof committee_id === "string")));
44
+ (election.district === undefined || typeof election.district === "number"));
48
45
  }
49
46
  }
50
47
  export class ElectionAux extends Election {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -95,7 +95,7 @@ export class Candidate {
95
95
 
96
96
  export class CandidateAux extends Candidate {
97
97
  readonly committees : CommitteeAux[]
98
- readonly fec_f3_files : FECF3File[]
98
+ // readonly fec_f3_files : FECF3File[]
99
99
 
100
100
  constructor(candidate : any) {
101
101
  if (!CandidateAux.is(candidate)) {
@@ -103,16 +103,14 @@ export class CandidateAux extends Candidate {
103
103
  }
104
104
  super(candidate)
105
105
  this.committees = candidate.committees
106
- this.fec_f3_files = candidate.fec_f3_files.map(fec_f3_file => new FECF3File(fec_f3_file))
106
+ // this.fec_f3_files = candidate.fec_f3_files.map(fec_f3_file => new FECF3File(fec_f3_file))
107
107
  }
108
108
 
109
109
  static is(candidate : any) : candidate is CandidateAux {
110
110
  return (
111
111
  Candidate.is(candidate) &&
112
112
  Array.isArray(candidate.committees) &&
113
- candidate.committees.every(CommitteeAux.is) &&
114
- Array.isArray(candidate.fec_f3_files) &&
115
- candidate.fec_f3_files.every(FECF3File.is)
113
+ candidate.committees.every(CommitteeAux.is)
116
114
  )
117
115
  }
118
116
  }
@@ -36,7 +36,6 @@ export class Election {
36
36
  readonly office_id : OfficeID
37
37
  readonly state_id : StateID
38
38
  readonly district? : number
39
- readonly committee_ids? : string[]
40
39
  readonly [x : string] : any
41
40
 
42
41
  constructor(election : Election) {
@@ -48,7 +47,6 @@ export class Election {
48
47
  this.office_id = election.office_id
49
48
  this.state_id = election.state_id
50
49
  this.district = election.district
51
- this.committee_ids = election.committee_ids
52
50
  }
53
51
 
54
52
  static is(election : any) : election is Election {
@@ -58,8 +56,7 @@ export class Election {
58
56
  typeof election.name === "string" &&
59
57
  is_office_id(election.office_id) &&
60
58
  is_state_id(election.state_id) &&
61
- (election.district === undefined || typeof election.district === "number") &&
62
- (election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id : any) => typeof committee_id === "string"))
59
+ (election.district === undefined || typeof election.district === "number")
63
60
  )
64
61
  }
65
62
  }