elections-types 1.0.67 → 1.0.68
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
|
}
|
package/package.json
CHANGED
package/src/types/Candidate.ts
CHANGED
|
@@ -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
|
}
|