elections-types 1.1.4 → 1.1.6
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/FederalElectionCandidate.d.ts +1 -0
- package/dist/src/types/FederalElectionCandidate.js +5 -2
- package/dist/src/types/Tweet.d.ts +1 -0
- package/dist/src/types/Tweet.js +2 -2
- package/package.json +1 -1
- package/src/types/FederalElectionCandidate.ts +5 -2
- package/src/types/Tweet.ts +2 -2
|
@@ -25,6 +25,7 @@ export declare class FederalElectionCandidate {
|
|
|
25
25
|
readonly ballotpedia_url?: string;
|
|
26
26
|
readonly ballotpedia_data?: Record<string, any>;
|
|
27
27
|
readonly activity_index?: ActivityIndex;
|
|
28
|
+
readonly is_veteran?: string;
|
|
28
29
|
[x: string]: any;
|
|
29
30
|
constructor(federal_election_candidate: FederalElectionCandidate);
|
|
30
31
|
static is(federal_election_candidate: any): federal_election_candidate is FederalElectionCandidate;
|
|
@@ -37,6 +37,7 @@ export class FederalElectionCandidate {
|
|
|
37
37
|
ballotpedia_url;
|
|
38
38
|
ballotpedia_data;
|
|
39
39
|
activity_index;
|
|
40
|
+
is_veteran;
|
|
40
41
|
constructor(federal_election_candidate) {
|
|
41
42
|
if (!FederalElectionCandidate.is(federal_election_candidate)) {
|
|
42
43
|
throw Error("Invalid input.");
|
|
@@ -54,7 +55,8 @@ export class FederalElectionCandidate {
|
|
|
54
55
|
this.ballotpedia_name = federal_election_candidate.ballotpedia_name;
|
|
55
56
|
this.ballotpedia_url = federal_election_candidate.ballotpedia_url;
|
|
56
57
|
this.ballotpedia_data = federal_election_candidate.ballotpedia_data;
|
|
57
|
-
this.activity_index = federal_election_candidate.activity_index
|
|
58
|
+
this.activity_index = federal_election_candidate.activity_index;
|
|
59
|
+
this.is_veteran = federal_election_candidate.is_veteran;
|
|
58
60
|
}
|
|
59
61
|
static is(federal_election_candidate) {
|
|
60
62
|
return (federal_election_candidate !== undefined &&
|
|
@@ -71,7 +73,8 @@ export class FederalElectionCandidate {
|
|
|
71
73
|
(federal_election_candidate.ballotpedia_name === undefined || typeof federal_election_candidate.ballotpedia_name === "string") &&
|
|
72
74
|
(federal_election_candidate.ballotpedia_url === undefined || typeof federal_election_candidate.ballotpedia_url === "string") &&
|
|
73
75
|
(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")) &&
|
|
74
|
-
(federal_election_candidate.activity_index === undefined || ActivityIndex.is(federal_election_candidate.activity_index))
|
|
76
|
+
(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 === "boolean"));
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
80
|
export class FederalElectionCandidateAux extends FederalElectionCandidate {
|
package/dist/src/types/Tweet.js
CHANGED
|
@@ -3,7 +3,7 @@ export class Tweet {
|
|
|
3
3
|
username;
|
|
4
4
|
url;
|
|
5
5
|
tweet_time;
|
|
6
|
-
|
|
6
|
+
tweet_content;
|
|
7
7
|
// readonly quote? : string
|
|
8
8
|
html;
|
|
9
9
|
// readonly text : string
|
|
@@ -15,7 +15,7 @@ export class Tweet {
|
|
|
15
15
|
this.username = tweet.username;
|
|
16
16
|
this.url = tweet.url;
|
|
17
17
|
this.tweet_time = tweet.tweet_time;
|
|
18
|
-
|
|
18
|
+
this.tweet_content = tweet.tweet_content;
|
|
19
19
|
// this.quote = tweet.quote
|
|
20
20
|
this.html = tweet.html;
|
|
21
21
|
// this.text = tweet.text
|
package/package.json
CHANGED
|
@@ -43,6 +43,7 @@ export class FederalElectionCandidate {
|
|
|
43
43
|
readonly ballotpedia_url? : string
|
|
44
44
|
readonly ballotpedia_data? : Record<string, any>
|
|
45
45
|
readonly activity_index? : ActivityIndex
|
|
46
|
+
readonly is_veteran? : string
|
|
46
47
|
// readonly urls? : string[]
|
|
47
48
|
// readonly previews? : string[]
|
|
48
49
|
[x : string] : any
|
|
@@ -65,7 +66,8 @@ export class FederalElectionCandidate {
|
|
|
65
66
|
this.ballotpedia_name = federal_election_candidate.ballotpedia_name
|
|
66
67
|
this.ballotpedia_url = federal_election_candidate.ballotpedia_url
|
|
67
68
|
this.ballotpedia_data = federal_election_candidate.ballotpedia_data
|
|
68
|
-
this.activity_index = federal_election_candidate.activity_index
|
|
69
|
+
this.activity_index = federal_election_candidate.activity_index
|
|
70
|
+
this.is_veteran = federal_election_candidate.is_veteran
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
static is(federal_election_candidate : any) : federal_election_candidate is FederalElectionCandidate {
|
|
@@ -84,7 +86,8 @@ export class FederalElectionCandidate {
|
|
|
84
86
|
(federal_election_candidate.ballotpedia_name === undefined || typeof federal_election_candidate.ballotpedia_name === "string") &&
|
|
85
87
|
(federal_election_candidate.ballotpedia_url === undefined || typeof federal_election_candidate.ballotpedia_url === "string") &&
|
|
86
88
|
(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")) &&
|
|
87
|
-
(federal_election_candidate.activity_index === undefined || ActivityIndex.is(federal_election_candidate.activity_index))
|
|
89
|
+
(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 === "boolean")
|
|
88
91
|
)
|
|
89
92
|
}
|
|
90
93
|
}
|
package/src/types/Tweet.ts
CHANGED
|
@@ -3,7 +3,7 @@ export class Tweet {
|
|
|
3
3
|
readonly username : string
|
|
4
4
|
readonly url : string
|
|
5
5
|
readonly tweet_time : string
|
|
6
|
-
|
|
6
|
+
readonly tweet_content? : string
|
|
7
7
|
// readonly quote? : string
|
|
8
8
|
readonly html : string
|
|
9
9
|
// readonly text : string
|
|
@@ -16,7 +16,7 @@ export class Tweet {
|
|
|
16
16
|
this.username = tweet.username
|
|
17
17
|
this.url = tweet.url
|
|
18
18
|
this.tweet_time = tweet.tweet_time
|
|
19
|
-
|
|
19
|
+
this.tweet_content = tweet.tweet_content
|
|
20
20
|
// this.quote = tweet.quote
|
|
21
21
|
this.html = tweet.html
|
|
22
22
|
// this.text = tweet.text
|