triangle-types 1.0.194 → 1.0.196

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.
@@ -114,7 +114,7 @@ export class LALFileVoter {
114
114
  (lal_file_voter.address_mail_city === undefined || typeof lal_file_voter.address_mail_city === "string") &&
115
115
  typeof lal_file_voter.address_mail_state_id === "string" &&
116
116
  (lal_file_voter.address_mail_zip_id === undefined || typeof lal_file_voter.address_mail_zip_id === "string") &&
117
- (lal_file_voter.party === undefined || typeof lal_file_voter.party_id === "string") &&
117
+ (lal_file_voter.party_id === undefined || typeof lal_file_voter.party_id === "string") &&
118
118
  is_voter_party_type_id(lal_file_voter.party_type_id) &&
119
119
  (lal_file_voter.lal_occupation_group_id === undefined || typeof lal_file_voter.lal_occupation_group_id === "string") &&
120
120
  (lal_file_voter.lal_occupation_id === undefined || typeof lal_file_voter.lal_occupation_id === "string") &&
@@ -2,11 +2,25 @@ import { LALFileVoter } from "../lal/LALFileVoter.js";
2
2
  import { StateID } from "../regions/State.js";
3
3
  import { StateVoterFeature } from "./StateVoterFeature.js";
4
4
  import { StateVoterTarget } from "./StateVoterTarget.js";
5
+ import { VoterPartyTypeID } from "./Voter.js";
5
6
  export declare class StateVoter {
6
7
  readonly state_id: StateID;
7
8
  readonly voter_id: string;
8
9
  readonly lal_file_id: string;
9
10
  readonly lal_voter_id: string;
11
+ readonly name_first: string;
12
+ readonly name_middle?: string;
13
+ readonly name_last: string;
14
+ readonly name_suffix?: string;
15
+ readonly address_residence_1: string;
16
+ readonly address_residence_2?: string;
17
+ readonly address_residence_city?: string;
18
+ readonly address_residence_state_id: string;
19
+ readonly address_residence_zip_id?: string;
20
+ readonly address_residence_latitude: number;
21
+ readonly address_residence_longitude: number;
22
+ readonly address_residence_coordinates_type_id: string;
23
+ readonly party_type_id: VoterPartyTypeID;
10
24
  readonly [x: string]: any;
11
25
  constructor(state_voter: any);
12
26
  static is(state_voter: any): state_voter is StateVoter;
@@ -2,11 +2,25 @@ import { LALFileVoter } from "../lal/LALFileVoter.js";
2
2
  import { is_state_id } from "../regions/State.js";
3
3
  import { StateVoterFeature } from "./StateVoterFeature.js";
4
4
  import { StateVoterTarget } from "./StateVoterTarget.js";
5
+ import { is_voter_party_type_id } from "./Voter.js";
5
6
  export class StateVoter {
6
7
  state_id;
7
8
  voter_id;
8
9
  lal_file_id;
9
10
  lal_voter_id;
11
+ name_first;
12
+ name_middle;
13
+ name_last;
14
+ name_suffix;
15
+ address_residence_1;
16
+ address_residence_2;
17
+ address_residence_city;
18
+ address_residence_state_id;
19
+ address_residence_zip_id;
20
+ address_residence_latitude;
21
+ address_residence_longitude;
22
+ address_residence_coordinates_type_id;
23
+ party_type_id;
10
24
  constructor(state_voter) {
11
25
  if (!StateVoter.is(state_voter)) {
12
26
  throw Error("Invalid input.");
@@ -15,20 +29,59 @@ export class StateVoter {
15
29
  this.voter_id = state_voter.voter_id;
16
30
  this.lal_file_id = state_voter.lal_file_id;
17
31
  this.lal_voter_id = state_voter.lal_voter_id;
32
+ this.name_first = state_voter.name_first;
33
+ this.name_middle = state_voter.name_middle;
34
+ this.name_last = state_voter.name_last;
35
+ this.name_suffix = state_voter.name_suffix;
36
+ this.address_residence_1 = state_voter.address_residence_1;
37
+ this.address_residence_2 = state_voter.address_residence_2;
38
+ this.address_residence_city = state_voter.address_residence_city;
39
+ this.address_residence_state_id = state_voter.address_residence_state_id;
40
+ this.address_residence_zip_id = state_voter.address_residence_zip_id;
41
+ this.address_residence_latitude = state_voter.address_residence_latitude;
42
+ this.address_residence_longitude = state_voter.address_residence_longitude;
43
+ this.address_residence_coordinates_type_id = state_voter.address_residence_coordinates_type_id;
44
+ this.party_type_id = state_voter.party_type_id;
18
45
  }
19
46
  static is(state_voter) {
20
47
  return (state_voter !== undefined &&
21
48
  is_state_id(state_voter.state_id) &&
22
49
  typeof state_voter.voter_id === "string" &&
23
50
  typeof state_voter.lal_file_id === "string" &&
24
- typeof state_voter.lal_voter_id === "string");
51
+ typeof state_voter.lal_voter_id === "string" &&
52
+ typeof state_voter.name_first === "string" &&
53
+ (state_voter.name_middle === undefined || typeof state_voter.name_middle === "string") &&
54
+ typeof state_voter.name_last === "string" &&
55
+ (state_voter.name_suffix === undefined || typeof state_voter.name_suffix === "string") &&
56
+ typeof state_voter.address_residence_1 === "string" &&
57
+ (state_voter.address_residence_2 === undefined || typeof state_voter.address_residence_2 === "string") &&
58
+ (state_voter.address_residence_city === undefined || typeof state_voter.address_residence_city === "string") &&
59
+ typeof state_voter.address_residence_state_id === "string" &&
60
+ (state_voter.address_residence_zip_id === undefined || typeof state_voter.address_residence_zip_id === "string") &&
61
+ typeof state_voter.address_residence_latitude === "number" && !isNaN(state_voter.address_residence_latitude) &&
62
+ typeof state_voter.address_residence_longitude === "number" && !isNaN(state_voter.address_residence_longitude) &&
63
+ typeof state_voter.address_residence_coordinates_type_id === "string" &&
64
+ is_voter_party_type_id(state_voter.party_type_id));
25
65
  }
26
66
  static keys() {
27
67
  return [
28
68
  "state_id",
29
69
  "voter_id",
30
70
  "lal_file_id",
31
- "lal_voter_id"
71
+ "lal_voter_id",
72
+ "name_first",
73
+ "name_middle",
74
+ "name_last",
75
+ "name_suffix",
76
+ "address_residence_1",
77
+ "address_residence_2",
78
+ "address_residence_city",
79
+ "address_residence_state_id",
80
+ "address_residence_zip_id",
81
+ "address_residence_latitude",
82
+ "address_residence_longitude",
83
+ "address_residence_coordinates_type_id",
84
+ "party_type_id"
32
85
  ];
33
86
  }
34
87
  }
@@ -1,6 +1,6 @@
1
1
  export declare class Scout {
2
2
  readonly scout_id: string;
3
- readonly name: string;
3
+ readonly name?: string;
4
4
  readonly ballotpedia_article_id?: string;
5
5
  readonly wikipedia_article_id?: string;
6
6
  readonly s3_id_img?: string;
@@ -25,7 +25,7 @@ export class Scout {
25
25
  return (scout !== undefined &&
26
26
  typeof scout.scout_id === "string" &&
27
27
  // is_scout_type_id(scout.scout_type_id) &&
28
- typeof scout.name === "string" &&
28
+ (scout.name === undefined || typeof scout.name === "string") &&
29
29
  (scout.ballotpedia_article_id === undefined || typeof scout.ballotpedia_article_id === "string") &&
30
30
  (scout.wikipedia_article_id === undefined || typeof scout.wikipedia_article_id === "string") &&
31
31
  (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.194",
3
+ "version": "1.0.196",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -119,7 +119,7 @@ export class LALFileVoter {
119
119
  (lal_file_voter.address_mail_city === undefined || typeof lal_file_voter.address_mail_city === "string") &&
120
120
  typeof lal_file_voter.address_mail_state_id === "string" &&
121
121
  (lal_file_voter.address_mail_zip_id === undefined || typeof lal_file_voter.address_mail_zip_id === "string") &&
122
- (lal_file_voter.party === undefined || typeof lal_file_voter.party_id === "string") &&
122
+ (lal_file_voter.party_id === undefined || typeof lal_file_voter.party_id === "string") &&
123
123
  is_voter_party_type_id(lal_file_voter.party_type_id) &&
124
124
  (lal_file_voter.lal_occupation_group_id === undefined || typeof lal_file_voter.lal_occupation_group_id === "string") &&
125
125
  (lal_file_voter.lal_occupation_id === undefined || typeof lal_file_voter.lal_occupation_id === "string") &&
@@ -2,12 +2,26 @@ import { LALFileVoter } from "../lal/LALFileVoter"
2
2
  import { is_state_id, StateID } from "../regions/State"
3
3
  import { StateVoterFeature } from "./StateVoterFeature"
4
4
  import { StateVoterTarget } from "./StateVoterTarget"
5
+ import { is_voter_party_type_id, VoterPartyTypeID } from "./Voter"
5
6
 
6
7
  export class StateVoter {
7
8
  readonly state_id : StateID
8
9
  readonly voter_id : string
9
10
  readonly lal_file_id : string
10
11
  readonly lal_voter_id : string
12
+ readonly name_first : string
13
+ readonly name_middle? : string
14
+ readonly name_last : string
15
+ readonly name_suffix? : string
16
+ readonly address_residence_1 : string
17
+ readonly address_residence_2? : string
18
+ readonly address_residence_city? : string
19
+ readonly address_residence_state_id : string
20
+ readonly address_residence_zip_id? : string
21
+ readonly address_residence_latitude : number
22
+ readonly address_residence_longitude : number
23
+ readonly address_residence_coordinates_type_id : string
24
+ readonly party_type_id : VoterPartyTypeID
11
25
  readonly [x : string] : any
12
26
 
13
27
  constructor(state_voter : any) {
@@ -18,6 +32,19 @@ export class StateVoter {
18
32
  this.voter_id = state_voter.voter_id
19
33
  this.lal_file_id = state_voter.lal_file_id
20
34
  this.lal_voter_id = state_voter.lal_voter_id
35
+ this.name_first = state_voter.name_first
36
+ this.name_middle = state_voter.name_middle
37
+ this.name_last = state_voter.name_last
38
+ this.name_suffix = state_voter.name_suffix
39
+ this.address_residence_1 = state_voter.address_residence_1
40
+ this.address_residence_2 = state_voter.address_residence_2
41
+ this.address_residence_city = state_voter.address_residence_city
42
+ this.address_residence_state_id = state_voter.address_residence_state_id
43
+ this.address_residence_zip_id = state_voter.address_residence_zip_id
44
+ this.address_residence_latitude = state_voter.address_residence_latitude
45
+ this.address_residence_longitude = state_voter.address_residence_longitude
46
+ this.address_residence_coordinates_type_id = state_voter.address_residence_coordinates_type_id
47
+ this.party_type_id = state_voter.party_type_id
21
48
  }
22
49
 
23
50
  static is(state_voter : any) : state_voter is StateVoter {
@@ -26,7 +53,20 @@ export class StateVoter {
26
53
  is_state_id(state_voter.state_id) &&
27
54
  typeof state_voter.voter_id === "string" &&
28
55
  typeof state_voter.lal_file_id === "string" &&
29
- typeof state_voter.lal_voter_id === "string"
56
+ typeof state_voter.lal_voter_id === "string" &&
57
+ typeof state_voter.name_first === "string" &&
58
+ (state_voter.name_middle === undefined || typeof state_voter.name_middle === "string") &&
59
+ typeof state_voter.name_last === "string" &&
60
+ (state_voter.name_suffix === undefined || typeof state_voter.name_suffix === "string") &&
61
+ typeof state_voter.address_residence_1 === "string" &&
62
+ (state_voter.address_residence_2 === undefined || typeof state_voter.address_residence_2 === "string") &&
63
+ (state_voter.address_residence_city === undefined || typeof state_voter.address_residence_city === "string") &&
64
+ typeof state_voter.address_residence_state_id === "string" &&
65
+ (state_voter.address_residence_zip_id === undefined || typeof state_voter.address_residence_zip_id === "string") &&
66
+ typeof state_voter.address_residence_latitude === "number" && !isNaN(state_voter.address_residence_latitude) &&
67
+ typeof state_voter.address_residence_longitude === "number" && !isNaN(state_voter.address_residence_longitude) &&
68
+ typeof state_voter.address_residence_coordinates_type_id === "string" &&
69
+ is_voter_party_type_id(state_voter.party_type_id)
30
70
  )
31
71
  }
32
72
 
@@ -35,7 +75,20 @@ export class StateVoter {
35
75
  "state_id",
36
76
  "voter_id",
37
77
  "lal_file_id",
38
- "lal_voter_id"
78
+ "lal_voter_id",
79
+ "name_first",
80
+ "name_middle",
81
+ "name_last",
82
+ "name_suffix",
83
+ "address_residence_1",
84
+ "address_residence_2",
85
+ "address_residence_city",
86
+ "address_residence_state_id",
87
+ "address_residence_zip_id",
88
+ "address_residence_latitude",
89
+ "address_residence_longitude",
90
+ "address_residence_coordinates_type_id",
91
+ "party_type_id"
39
92
  ]
40
93
  }
41
94
  }
@@ -12,7 +12,7 @@ import { StateID } from "../regions/State"
12
12
  export class Scout {
13
13
  readonly scout_id : string
14
14
  // readonly scout_type_id : ScoutTypeID
15
- readonly name : string
15
+ readonly name? : string
16
16
  readonly ballotpedia_article_id? : string
17
17
  readonly wikipedia_article_id? : string
18
18
  readonly s3_id_img? : string
@@ -35,7 +35,7 @@ export class Scout {
35
35
  scout !== undefined &&
36
36
  typeof scout.scout_id === "string" &&
37
37
  // is_scout_type_id(scout.scout_type_id) &&
38
- typeof scout.name === "string" &&
38
+ (scout.name === undefined || typeof scout.name === "string") &&
39
39
  (scout.ballotpedia_article_id === undefined || typeof scout.ballotpedia_article_id === "string") &&
40
40
  (scout.wikipedia_article_id === undefined || typeof scout.wikipedia_article_id === "string") &&
41
41
  (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")