elections-types 1.1.7 → 1.1.9
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.
|
@@ -26,6 +26,7 @@ export declare class FederalElectionCandidate {
|
|
|
26
26
|
readonly ballotpedia_data?: Record<string, any>;
|
|
27
27
|
readonly activity_index?: ActivityIndex;
|
|
28
28
|
readonly is_veteran?: string;
|
|
29
|
+
readonly url_veteran?: string;
|
|
29
30
|
[x: string]: any;
|
|
30
31
|
constructor(federal_election_candidate: FederalElectionCandidate);
|
|
31
32
|
static is(federal_election_candidate: any): federal_election_candidate is FederalElectionCandidate;
|
|
@@ -38,6 +38,7 @@ export class FederalElectionCandidate {
|
|
|
38
38
|
ballotpedia_data;
|
|
39
39
|
activity_index;
|
|
40
40
|
is_veteran;
|
|
41
|
+
url_veteran;
|
|
41
42
|
constructor(federal_election_candidate) {
|
|
42
43
|
if (!FederalElectionCandidate.is(federal_election_candidate)) {
|
|
43
44
|
throw Error("Invalid input.");
|
|
@@ -57,6 +58,7 @@ export class FederalElectionCandidate {
|
|
|
57
58
|
this.ballotpedia_data = federal_election_candidate.ballotpedia_data;
|
|
58
59
|
this.activity_index = federal_election_candidate.activity_index;
|
|
59
60
|
this.is_veteran = federal_election_candidate.is_veteran;
|
|
61
|
+
this.url_veteran = federal_election_candidate.url_veteran;
|
|
60
62
|
}
|
|
61
63
|
static is(federal_election_candidate) {
|
|
62
64
|
return (federal_election_candidate !== undefined &&
|
|
@@ -74,7 +76,8 @@ export class FederalElectionCandidate {
|
|
|
74
76
|
(federal_election_candidate.ballotpedia_url === undefined || typeof federal_election_candidate.ballotpedia_url === "string") &&
|
|
75
77
|
(federal_election_candidate.ballotpedia_data === undefined || typeof federal_election_candidate.ballotpedia_data === "object" && Object.keys(federal_election_candidate.ballotpedia_data).map((key) => typeof key === "string")) &&
|
|
76
78
|
(federal_election_candidate.activity_index === undefined || ActivityIndex.is(federal_election_candidate.activity_index)) &&
|
|
77
|
-
(federal_election_candidate.is_veteran === undefined || typeof federal_election_candidate.is_veteran === "
|
|
79
|
+
(federal_election_candidate.is_veteran === undefined || typeof federal_election_candidate.is_veteran === "string") &&
|
|
80
|
+
(federal_election_candidate.url_veteran === undefined || typeof federal_election_candidate.url_veteran === "string"));
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
export class FederalElectionCandidateAux extends FederalElectionCandidate {
|
package/package.json
CHANGED
|
@@ -44,6 +44,7 @@ export class FederalElectionCandidate {
|
|
|
44
44
|
readonly ballotpedia_data? : Record<string, any>
|
|
45
45
|
readonly activity_index? : ActivityIndex
|
|
46
46
|
readonly is_veteran? : string
|
|
47
|
+
readonly url_veteran? : string
|
|
47
48
|
// readonly urls? : string[]
|
|
48
49
|
// readonly previews? : string[]
|
|
49
50
|
[x : string] : any
|
|
@@ -68,6 +69,7 @@ export class FederalElectionCandidate {
|
|
|
68
69
|
this.ballotpedia_data = federal_election_candidate.ballotpedia_data
|
|
69
70
|
this.activity_index = federal_election_candidate.activity_index
|
|
70
71
|
this.is_veteran = federal_election_candidate.is_veteran
|
|
72
|
+
this.url_veteran = federal_election_candidate.url_veteran
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
static is(federal_election_candidate : any) : federal_election_candidate is FederalElectionCandidate {
|
|
@@ -87,7 +89,8 @@ export class FederalElectionCandidate {
|
|
|
87
89
|
(federal_election_candidate.ballotpedia_url === undefined || typeof federal_election_candidate.ballotpedia_url === "string") &&
|
|
88
90
|
(federal_election_candidate.ballotpedia_data === undefined || typeof federal_election_candidate.ballotpedia_data === "object" && Object.keys(federal_election_candidate.ballotpedia_data).map((key : any) => typeof key === "string")) &&
|
|
89
91
|
(federal_election_candidate.activity_index === undefined || ActivityIndex.is(federal_election_candidate.activity_index)) &&
|
|
90
|
-
(federal_election_candidate.is_veteran === undefined || typeof federal_election_candidate.is_veteran === "
|
|
92
|
+
(federal_election_candidate.is_veteran === undefined || typeof federal_election_candidate.is_veteran === "string") &&
|
|
93
|
+
(federal_election_candidate.url_veteran === undefined || typeof federal_election_candidate.url_veteran === "string")
|
|
91
94
|
)
|
|
92
95
|
}
|
|
93
96
|
}
|