elections-types 1.0.59 → 1.0.61
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.
|
@@ -21,10 +21,6 @@ export declare class Candidate {
|
|
|
21
21
|
readonly status?: string;
|
|
22
22
|
readonly fec_file_id?: number;
|
|
23
23
|
readonly committee_ids?: string[];
|
|
24
|
-
readonly principal_committee_ids?: string[];
|
|
25
|
-
readonly authorized_committee_ids?: string[];
|
|
26
|
-
readonly sponsor_committee_ids?: string[];
|
|
27
|
-
readonly expenditure_ids?: string[];
|
|
28
24
|
readonly ballotpedia_name?: string;
|
|
29
25
|
readonly ballotpedia_url?: string;
|
|
30
26
|
readonly ballotpedia_data?: Record<string, any>;
|
|
@@ -33,10 +33,6 @@ export class Candidate {
|
|
|
33
33
|
status;
|
|
34
34
|
fec_file_id;
|
|
35
35
|
committee_ids;
|
|
36
|
-
principal_committee_ids;
|
|
37
|
-
authorized_committee_ids;
|
|
38
|
-
sponsor_committee_ids;
|
|
39
|
-
expenditure_ids;
|
|
40
36
|
ballotpedia_name;
|
|
41
37
|
ballotpedia_url;
|
|
42
38
|
ballotpedia_data;
|
|
@@ -56,14 +52,10 @@ export class Candidate {
|
|
|
56
52
|
this.status = candidate.status;
|
|
57
53
|
this.fec_file_id = candidate.fec_file_id;
|
|
58
54
|
this.committee_ids = candidate.committee_ids;
|
|
59
|
-
this.principal_committee_ids = candidate.principal_committee_ids;
|
|
60
|
-
this.authorized_committee_ids = candidate.authorized_committee_ids;
|
|
61
|
-
this.sponsor_committee_ids = candidate.sponsor_committee_ids;
|
|
62
|
-
this.expenditure_ids = candidate.expenditure_ids;
|
|
63
55
|
this.ballotpedia_name = candidate.ballotpedia_name;
|
|
64
56
|
this.ballotpedia_url = candidate.ballotpedia_url;
|
|
65
57
|
this.ballotpedia_data = candidate.ballotpedia_data;
|
|
66
|
-
this.activity_index = new ActivityIndex(candidate.activity_index);
|
|
58
|
+
this.activity_index = candidate.activity_index !== undefined ? new ActivityIndex(candidate.activity_index) : undefined;
|
|
67
59
|
}
|
|
68
60
|
static is(candidate) {
|
|
69
61
|
return (candidate !== undefined &&
|
|
@@ -78,10 +70,6 @@ export class Candidate {
|
|
|
78
70
|
(candidate.status === undefined || typeof candidate.status === "string") &&
|
|
79
71
|
(candidate.fec_file_id === undefined || typeof candidate.fec_file_id === "number" && !isNaN(candidate.fec_file_id)) &&
|
|
80
72
|
(candidate.committee_ids === undefined || Array.isArray(candidate.committee_ids) && candidate.committee_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
81
|
-
(candidate.principal_committee_ids === undefined || Array.isArray(candidate.principal_committee_ids) && candidate.principal_committee_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
82
|
-
(candidate.authorized_committee_ids === undefined || Array.isArray(candidate.authorized_committee_ids) && candidate.authorized_committee_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
83
|
-
(candidate.sponsor_committee_ids === undefined || Array.isArray(candidate.sponsor_committee_ids) && candidate.sponsor_committee_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
84
|
-
(candidate.expenditure_ids === undefined || Array.isArray(candidate.expenditure_ids) && candidate.expenditure_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
85
73
|
(candidate.ballotpedia_name === undefined || typeof candidate.ballotpedia_name === "string") &&
|
|
86
74
|
(candidate.ballotpedia_url === undefined || typeof candidate.ballotpedia_url === "string") &&
|
|
87
75
|
(candidate.ballotpedia_data === undefined || typeof candidate.ballotpedia_data === "object" && Object.keys(candidate.ballotpedia_data).map((key) => typeof key === "string")) &&
|
|
@@ -9,9 +9,7 @@ export declare class Committee {
|
|
|
9
9
|
readonly url?: string;
|
|
10
10
|
readonly designation?: CommitteeDesignation;
|
|
11
11
|
readonly fec_file_id?: number;
|
|
12
|
-
readonly
|
|
13
|
-
readonly authorized_committee_ids?: string[];
|
|
14
|
-
readonly sponsor_committee_ids?: string[];
|
|
12
|
+
readonly sponsor_candidate_ids?: string[];
|
|
15
13
|
readonly jfp_committee_ids?: string[];
|
|
16
14
|
readonly jfr_committee_ids?: string[];
|
|
17
15
|
readonly aff_committee_ids?: string[];
|
|
@@ -10,9 +10,7 @@ export class Committee {
|
|
|
10
10
|
url;
|
|
11
11
|
designation;
|
|
12
12
|
fec_file_id;
|
|
13
|
-
|
|
14
|
-
authorized_committee_ids;
|
|
15
|
-
sponsor_committee_ids;
|
|
13
|
+
sponsor_candidate_ids;
|
|
16
14
|
jfp_committee_ids;
|
|
17
15
|
jfr_committee_ids;
|
|
18
16
|
aff_committee_ids;
|
|
@@ -27,9 +25,7 @@ export class Committee {
|
|
|
27
25
|
this.url = committee.url;
|
|
28
26
|
this.designation = committee.designation;
|
|
29
27
|
this.fec_file_id = committee.fec_file_id;
|
|
30
|
-
this.
|
|
31
|
-
this.authorized_committee_ids = committee.authorized_committee_ids;
|
|
32
|
-
this.sponsor_committee_ids = committee.sponsor_committee_ids;
|
|
28
|
+
this.sponsor_candidate_ids = committee.sponsor_candidate_ids;
|
|
33
29
|
this.jfp_committee_ids = committee.jfp_committee_ids;
|
|
34
30
|
this.jfr_committee_ids = committee.jfr_committee_ids;
|
|
35
31
|
this.aff_committee_ids = committee.aff_committee_ids;
|
|
@@ -43,9 +39,7 @@ export class Committee {
|
|
|
43
39
|
(committee.url === undefined || typeof committee.url === "string") &&
|
|
44
40
|
(committee.designation === undefined || is_committee_designation(committee.designation)) &&
|
|
45
41
|
(committee.fec_file_id === undefined || typeof committee.fec_file_id === "number" && !isNaN(committee.fec_file_id)) &&
|
|
46
|
-
(committee.
|
|
47
|
-
(committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
48
|
-
(committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
42
|
+
(committee.sponsor_candidate_ids === undefined || Array.isArray(committee.sponsor_candidate_ids) && committee.sponsor_candidate_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
49
43
|
(committee.jfp_committee_ids === undefined || Array.isArray(committee.jfp_committee_ids) && committee.jfp_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
50
44
|
(committee.jfr_committee_ids === undefined || Array.isArray(committee.jfr_committee_ids) && committee.jfr_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
51
45
|
(committee.aff_committee_ids === undefined || Array.isArray(committee.aff_committee_ids) && committee.aff_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
package/package.json
CHANGED
package/src/types/Candidate.ts
CHANGED
|
@@ -39,10 +39,6 @@ export class Candidate {
|
|
|
39
39
|
readonly status? : string
|
|
40
40
|
readonly fec_file_id? : number
|
|
41
41
|
readonly committee_ids? : string[]
|
|
42
|
-
readonly principal_committee_ids? : string[]
|
|
43
|
-
readonly authorized_committee_ids? : string[]
|
|
44
|
-
readonly sponsor_committee_ids? : string[]
|
|
45
|
-
readonly expenditure_ids? : string[]
|
|
46
42
|
readonly ballotpedia_name? : string
|
|
47
43
|
readonly ballotpedia_url? : string
|
|
48
44
|
readonly ballotpedia_data? : Record<string, any>
|
|
@@ -67,14 +63,10 @@ export class Candidate {
|
|
|
67
63
|
this.status = candidate.status
|
|
68
64
|
this.fec_file_id = candidate.fec_file_id
|
|
69
65
|
this.committee_ids = candidate.committee_ids
|
|
70
|
-
this.principal_committee_ids = candidate.principal_committee_ids
|
|
71
|
-
this.authorized_committee_ids = candidate.authorized_committee_ids
|
|
72
|
-
this.sponsor_committee_ids = candidate.sponsor_committee_ids
|
|
73
|
-
this.expenditure_ids = candidate.expenditure_ids
|
|
74
66
|
this.ballotpedia_name = candidate.ballotpedia_name
|
|
75
67
|
this.ballotpedia_url = candidate.ballotpedia_url
|
|
76
68
|
this.ballotpedia_data = candidate.ballotpedia_data
|
|
77
|
-
this.activity_index = new ActivityIndex(candidate.activity_index)
|
|
69
|
+
this.activity_index = candidate.activity_index !== undefined ? new ActivityIndex(candidate.activity_index) : undefined
|
|
78
70
|
}
|
|
79
71
|
|
|
80
72
|
static is(candidate : any) : candidate is Candidate {
|
|
@@ -91,10 +83,6 @@ export class Candidate {
|
|
|
91
83
|
(candidate.status === undefined || typeof candidate.status === "string") &&
|
|
92
84
|
(candidate.fec_file_id === undefined || typeof candidate.fec_file_id === "number" && !isNaN(candidate.fec_file_id)) &&
|
|
93
85
|
(candidate.committee_ids === undefined || Array.isArray(candidate.committee_ids) && candidate.committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
94
|
-
(candidate.principal_committee_ids === undefined || Array.isArray(candidate.principal_committee_ids) && candidate.principal_committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
95
|
-
(candidate.authorized_committee_ids === undefined || Array.isArray(candidate.authorized_committee_ids) && candidate.authorized_committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
96
|
-
(candidate.sponsor_committee_ids === undefined || Array.isArray(candidate.sponsor_committee_ids) && candidate.sponsor_committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
97
|
-
(candidate.expenditure_ids === undefined || Array.isArray(candidate.expenditure_ids) && candidate.expenditure_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
98
86
|
(candidate.ballotpedia_name === undefined || typeof candidate.ballotpedia_name === "string") &&
|
|
99
87
|
(candidate.ballotpedia_url === undefined || typeof candidate.ballotpedia_url === "string") &&
|
|
100
88
|
(candidate.ballotpedia_data === undefined || typeof candidate.ballotpedia_data === "object" && Object.keys(candidate.ballotpedia_data).map((key : any) => typeof key === "string")) &&
|
package/src/types/Committee.ts
CHANGED
|
@@ -15,9 +15,7 @@ export class Committee {
|
|
|
15
15
|
readonly url? : string
|
|
16
16
|
readonly designation? : CommitteeDesignation
|
|
17
17
|
readonly fec_file_id? : number
|
|
18
|
-
readonly
|
|
19
|
-
readonly authorized_committee_ids? : string[]
|
|
20
|
-
readonly sponsor_committee_ids? : string[]
|
|
18
|
+
readonly sponsor_candidate_ids? : string[]
|
|
21
19
|
readonly jfp_committee_ids? : string[]
|
|
22
20
|
readonly jfr_committee_ids? : string[]
|
|
23
21
|
readonly aff_committee_ids? : string[]
|
|
@@ -34,9 +32,7 @@ export class Committee {
|
|
|
34
32
|
this.url = committee.url
|
|
35
33
|
this.designation = committee.designation
|
|
36
34
|
this.fec_file_id = committee.fec_file_id
|
|
37
|
-
this.
|
|
38
|
-
this.authorized_committee_ids = committee.authorized_committee_ids
|
|
39
|
-
this.sponsor_committee_ids = committee.sponsor_committee_ids
|
|
35
|
+
this.sponsor_candidate_ids = committee.sponsor_candidate_ids
|
|
40
36
|
this.jfp_committee_ids = committee.jfp_committee_ids
|
|
41
37
|
this.jfr_committee_ids = committee.jfr_committee_ids
|
|
42
38
|
this.aff_committee_ids = committee.aff_committee_ids
|
|
@@ -52,9 +48,7 @@ export class Committee {
|
|
|
52
48
|
(committee.url === undefined || typeof committee.url === "string") &&
|
|
53
49
|
(committee.designation === undefined || is_committee_designation(committee.designation)) &&
|
|
54
50
|
(committee.fec_file_id === undefined || typeof committee.fec_file_id === "number" && !isNaN(committee.fec_file_id)) &&
|
|
55
|
-
(committee.
|
|
56
|
-
(committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
57
|
-
(committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
51
|
+
(committee.sponsor_candidate_ids === undefined || Array.isArray(committee.sponsor_candidate_ids) && committee.sponsor_candidate_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
58
52
|
(committee.jfp_committee_ids === undefined || Array.isArray(committee.jfp_committee_ids) && committee.jfp_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
59
53
|
(committee.jfr_committee_ids === undefined || Array.isArray(committee.jfr_committee_ids) && committee.jfr_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
60
54
|
(committee.aff_committee_ids === undefined || Array.isArray(committee.aff_committee_ids) && committee.aff_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|