elections-types 1.0.65 → 1.0.66
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.
- package/dist/src/types/Candidate.d.ts +2 -2
- package/dist/src/types/Candidate.js +5 -5
- package/dist/src/types/CandidateCommittee.d.ts +0 -6
- package/dist/src/types/CandidateCommittee.js +16 -15
- package/package.json +1 -1
- package/src/types/Candidate.ts +4 -5
- package/src/types/CandidateCommittee.ts +16 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommitteeAux } from "./Committee.js";
|
|
2
2
|
import { ElectionID, OfficeID } from "./Election.js";
|
|
3
3
|
import { FECF3File } from "./FECF3File.js";
|
|
4
4
|
import { StateID } from "./State.js";
|
|
@@ -30,7 +30,7 @@ export declare class Candidate {
|
|
|
30
30
|
static is(candidate: any): candidate is Candidate;
|
|
31
31
|
}
|
|
32
32
|
export declare class CandidateAux extends Candidate {
|
|
33
|
-
readonly
|
|
33
|
+
readonly committees: CommitteeAux[];
|
|
34
34
|
readonly fec_f3_files: FECF3File[];
|
|
35
35
|
constructor(candidate: any);
|
|
36
36
|
static is(candidate: any): candidate is CandidateAux;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommitteeAux } from "./Committee.js";
|
|
2
2
|
import { is_election_id, is_office_id } from "./Election.js";
|
|
3
3
|
import { FECF3File } from "./FECF3File.js";
|
|
4
4
|
import { is_state_id } from "./State.js";
|
|
@@ -77,20 +77,20 @@ export class Candidate {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
export class CandidateAux extends Candidate {
|
|
80
|
-
|
|
80
|
+
committees;
|
|
81
81
|
fec_f3_files;
|
|
82
82
|
constructor(candidate) {
|
|
83
83
|
if (!CandidateAux.is(candidate)) {
|
|
84
84
|
throw Error("Invalid input.");
|
|
85
85
|
}
|
|
86
86
|
super(candidate);
|
|
87
|
-
this.
|
|
87
|
+
this.committees = candidate.committees;
|
|
88
88
|
this.fec_f3_files = candidate.fec_f3_files.map(fec_f3_file => new FECF3File(fec_f3_file));
|
|
89
89
|
}
|
|
90
90
|
static is(candidate) {
|
|
91
91
|
return (Candidate.is(candidate) &&
|
|
92
|
-
Array.isArray(candidate.
|
|
93
|
-
candidate.
|
|
92
|
+
Array.isArray(candidate.committees) &&
|
|
93
|
+
candidate.committees.every(CommitteeAux.is) &&
|
|
94
94
|
Array.isArray(candidate.fec_f3_files) &&
|
|
95
95
|
candidate.fec_f3_files.every(FECF3File.is));
|
|
96
96
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CommitteeAux } from "./Committee.js";
|
|
2
1
|
export declare class CandidateCommittee {
|
|
3
2
|
readonly candidate_id: string;
|
|
4
3
|
readonly committee_id: string;
|
|
@@ -6,8 +5,3 @@ export declare class CandidateCommittee {
|
|
|
6
5
|
constructor(candidate_committee: CandidateCommittee);
|
|
7
6
|
static is(candidate_committee: any): candidate_committee is CandidateCommittee;
|
|
8
7
|
}
|
|
9
|
-
export declare class CandidateCommitteeAux extends CandidateCommittee {
|
|
10
|
-
readonly committee: CommitteeAux;
|
|
11
|
-
constructor(candidate_committee: any);
|
|
12
|
-
static is(candidate_committee: any): candidate_committee is CandidateCommitteeAux;
|
|
13
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CommitteeAux } from "./Committee.js";
|
|
2
1
|
export class CandidateCommittee {
|
|
3
2
|
candidate_id;
|
|
4
3
|
committee_id;
|
|
@@ -15,17 +14,19 @@ export class CandidateCommittee {
|
|
|
15
14
|
typeof candidate_committee.committee_id === "string");
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
export class CandidateCommitteeAux extends CandidateCommittee {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
17
|
+
// export class CandidateCommitteeAux extends CandidateCommittee {
|
|
18
|
+
// readonly committee : CommitteeAux
|
|
19
|
+
// constructor(candidate_committee : any) {
|
|
20
|
+
// if (!CandidateCommitteeAux.is(candidate_committee)) {
|
|
21
|
+
// throw Error("Invalid input.")
|
|
22
|
+
// }
|
|
23
|
+
// super(candidate_committee)
|
|
24
|
+
// this.committee = candidate_committee.committee
|
|
25
|
+
// }
|
|
26
|
+
// static is(candidate_committee : any) : candidate_committee is CandidateCommitteeAux {
|
|
27
|
+
// return (
|
|
28
|
+
// CandidateCommittee.is(candidate_committee) &&
|
|
29
|
+
// CommitteeAux.is(candidate_committee.committee)
|
|
30
|
+
// )
|
|
31
|
+
// }
|
|
32
|
+
// }
|
package/package.json
CHANGED
package/src/types/Candidate.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CandidateCommitteeAux } from "./CandidateCommittee"
|
|
2
1
|
import { Committee, CommitteeAux } from "./Committee"
|
|
3
2
|
import { ElectionID, is_election_id, is_office_id, OfficeID } from "./Election"
|
|
4
3
|
import { FECF24File } from "./FECF24File"
|
|
@@ -95,7 +94,7 @@ export class Candidate {
|
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
export class CandidateAux extends Candidate {
|
|
98
|
-
readonly
|
|
97
|
+
readonly committees : CommitteeAux[]
|
|
99
98
|
readonly fec_f3_files : FECF3File[]
|
|
100
99
|
|
|
101
100
|
constructor(candidate : any) {
|
|
@@ -103,15 +102,15 @@ export class CandidateAux extends Candidate {
|
|
|
103
102
|
throw Error("Invalid input.")
|
|
104
103
|
}
|
|
105
104
|
super(candidate)
|
|
106
|
-
this.
|
|
105
|
+
this.committees = candidate.committees
|
|
107
106
|
this.fec_f3_files = candidate.fec_f3_files.map(fec_f3_file => new FECF3File(fec_f3_file))
|
|
108
107
|
}
|
|
109
108
|
|
|
110
109
|
static is(candidate : any) : candidate is CandidateAux {
|
|
111
110
|
return (
|
|
112
111
|
Candidate.is(candidate) &&
|
|
113
|
-
Array.isArray(candidate.
|
|
114
|
-
candidate.
|
|
112
|
+
Array.isArray(candidate.committees) &&
|
|
113
|
+
candidate.committees.every(CommitteeAux.is) &&
|
|
115
114
|
Array.isArray(candidate.fec_f3_files) &&
|
|
116
115
|
candidate.fec_f3_files.every(FECF3File.is)
|
|
117
116
|
)
|
|
@@ -22,21 +22,21 @@ export class CandidateCommittee {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export class CandidateCommitteeAux extends CandidateCommittee {
|
|
26
|
-
|
|
25
|
+
// export class CandidateCommitteeAux extends CandidateCommittee {
|
|
26
|
+
// readonly committee : CommitteeAux
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
// constructor(candidate_committee : any) {
|
|
29
|
+
// if (!CandidateCommitteeAux.is(candidate_committee)) {
|
|
30
|
+
// throw Error("Invalid input.")
|
|
31
|
+
// }
|
|
32
|
+
// super(candidate_committee)
|
|
33
|
+
// this.committee = candidate_committee.committee
|
|
34
|
+
// }
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
36
|
+
// static is(candidate_committee : any) : candidate_committee is CandidateCommitteeAux {
|
|
37
|
+
// return (
|
|
38
|
+
// CandidateCommittee.is(candidate_committee) &&
|
|
39
|
+
// CommitteeAux.is(candidate_committee.committee)
|
|
40
|
+
// )
|
|
41
|
+
// }
|
|
42
|
+
// }
|