elections-types 1.1.5 → 1.1.7

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.
@@ -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 !== undefined ? new ActivityIndex(federal_election_candidate.activity_index) : undefined;
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 {
@@ -3,7 +3,7 @@ export declare class Tweet {
3
3
  readonly username: string;
4
4
  readonly url: string;
5
5
  readonly tweet_time: string;
6
- readonly tweet_content: string;
6
+ readonly tweet_content?: string;
7
7
  readonly html: string;
8
8
  constructor(tweet: Tweet);
9
9
  static is(tweet: any): tweet is Tweet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -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 !== undefined ? new ActivityIndex(federal_election_candidate.activity_index) : undefined
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
  }
@@ -3,7 +3,7 @@ export class Tweet {
3
3
  readonly username : string
4
4
  readonly url : string
5
5
  readonly tweet_time : string
6
- readonly tweet_content : string
6
+ readonly tweet_content? : string
7
7
  // readonly quote? : string
8
8
  readonly html : string
9
9
  // readonly text : string