triangle-types 1.0.183 → 1.0.185
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { VoterPartyTypeID } from "../prism/Voter.js";
|
|
2
2
|
import { StateID } from "../regions/State.js";
|
|
3
3
|
export declare class LALFileVoter {
|
|
4
|
-
readonly lal_file_voter_id: string;
|
|
5
4
|
readonly lal_file_id: string;
|
|
6
5
|
readonly lal_voter_id: string;
|
|
7
6
|
readonly state_id: StateID;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { is_voter_party_type_id } from "../prism/Voter.js";
|
|
2
2
|
import { is_state_id } from "../regions/State.js";
|
|
3
3
|
export class LALFileVoter {
|
|
4
|
-
lal_file_voter_id;
|
|
5
4
|
lal_file_id;
|
|
6
5
|
lal_voter_id;
|
|
7
6
|
state_id;
|
|
@@ -45,7 +44,6 @@ export class LALFileVoter {
|
|
|
45
44
|
if (!LALFileVoter.is(lal_file_voter)) {
|
|
46
45
|
throw Error("Invalid input.");
|
|
47
46
|
}
|
|
48
|
-
this.lal_file_voter_id = lal_file_voter.lal_file_voter_id;
|
|
49
47
|
this.lal_file_id = lal_file_voter.lal_file_id;
|
|
50
48
|
this.lal_voter_id = lal_file_voter.lal_voter_id;
|
|
51
49
|
this.state_id = lal_file_voter.state_id;
|
|
@@ -88,7 +86,6 @@ export class LALFileVoter {
|
|
|
88
86
|
}
|
|
89
87
|
static is(lal_file_voter) {
|
|
90
88
|
return (lal_file_voter !== undefined &&
|
|
91
|
-
typeof lal_file_voter.lal_file_voter_id === "string" &&
|
|
92
89
|
typeof lal_file_voter.lal_file_id === "string" &&
|
|
93
90
|
typeof lal_file_voter.lal_voter_id === "string" &&
|
|
94
91
|
is_state_id(lal_file_voter.state_id) &&
|
|
@@ -10,6 +10,7 @@ export declare class Prism {
|
|
|
10
10
|
readonly county_id?: string;
|
|
11
11
|
readonly school_district_id?: string;
|
|
12
12
|
readonly party_type_ids?: VoterPartyTypeID[];
|
|
13
|
+
readonly target_ids: string[];
|
|
13
14
|
readonly [x: string]: any;
|
|
14
15
|
constructor(prism: any);
|
|
15
16
|
static is(prism: any): prism is Prism;
|
|
@@ -10,6 +10,7 @@ export class Prism {
|
|
|
10
10
|
county_id;
|
|
11
11
|
school_district_id;
|
|
12
12
|
party_type_ids;
|
|
13
|
+
target_ids;
|
|
13
14
|
constructor(prism) {
|
|
14
15
|
if (!Prism.is(prism)) {
|
|
15
16
|
throw Error("Invalid input.");
|
|
@@ -23,6 +24,7 @@ export class Prism {
|
|
|
23
24
|
this.county_id = prism.county_id;
|
|
24
25
|
this.school_district_id = prism.school_district_id;
|
|
25
26
|
this.party_type_ids = prism.party_type_ids;
|
|
27
|
+
this.target_ids = prism.target_ids;
|
|
26
28
|
}
|
|
27
29
|
static is(prism) {
|
|
28
30
|
return (prism !== undefined &&
|
|
@@ -34,6 +36,7 @@ export class Prism {
|
|
|
34
36
|
(prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
|
|
35
37
|
(prism.county_id === undefined || typeof prism.county_id === "string") &&
|
|
36
38
|
(prism.school_district_id === undefined || typeof prism.school_district_id === "string") &&
|
|
37
|
-
(prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id))
|
|
39
|
+
(prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id)) &&
|
|
40
|
+
Array.isArray(prism.target_ids) && prism.target_ids.every((target_id) => typeof target_id === "string"));
|
|
38
41
|
}
|
|
39
42
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,6 @@ import { is_voter_party_type_id, VoterPartyTypeID } from "../prism/Voter"
|
|
|
2
2
|
import { is_state_id, StateID } from "../regions/State"
|
|
3
3
|
|
|
4
4
|
export class LALFileVoter {
|
|
5
|
-
readonly lal_file_voter_id : string
|
|
6
5
|
readonly lal_file_id : string
|
|
7
6
|
readonly lal_voter_id : string
|
|
8
7
|
readonly state_id : StateID
|
|
@@ -48,7 +47,6 @@ export class LALFileVoter {
|
|
|
48
47
|
if (!LALFileVoter.is(lal_file_voter)) {
|
|
49
48
|
throw Error("Invalid input.")
|
|
50
49
|
}
|
|
51
|
-
this.lal_file_voter_id = lal_file_voter.lal_file_voter_id
|
|
52
50
|
this.lal_file_id = lal_file_voter.lal_file_id
|
|
53
51
|
this.lal_voter_id = lal_file_voter.lal_voter_id
|
|
54
52
|
this.state_id = lal_file_voter.state_id
|
|
@@ -93,7 +91,6 @@ export class LALFileVoter {
|
|
|
93
91
|
static is(lal_file_voter : any) : lal_file_voter is LALFileVoter {
|
|
94
92
|
return (
|
|
95
93
|
lal_file_voter !== undefined &&
|
|
96
|
-
typeof lal_file_voter.lal_file_voter_id === "string" &&
|
|
97
94
|
typeof lal_file_voter.lal_file_id === "string" &&
|
|
98
95
|
typeof lal_file_voter.lal_voter_id === "string" &&
|
|
99
96
|
is_state_id(lal_file_voter.state_id) &&
|
package/src/types/prism/Prism.ts
CHANGED
|
@@ -11,6 +11,7 @@ export class Prism {
|
|
|
11
11
|
readonly county_id? : string
|
|
12
12
|
readonly school_district_id? : string
|
|
13
13
|
readonly party_type_ids? : VoterPartyTypeID[]
|
|
14
|
+
readonly target_ids : string[]
|
|
14
15
|
readonly [x : string] : any
|
|
15
16
|
|
|
16
17
|
constructor(prism : any) {
|
|
@@ -26,6 +27,7 @@ export class Prism {
|
|
|
26
27
|
this.county_id = prism.county_id
|
|
27
28
|
this.school_district_id = prism.school_district_id
|
|
28
29
|
this.party_type_ids = prism.party_type_ids
|
|
30
|
+
this.target_ids = prism.target_ids
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
static is(prism : any) : prism is Prism {
|
|
@@ -39,7 +41,8 @@ export class Prism {
|
|
|
39
41
|
(prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
|
|
40
42
|
(prism.county_id === undefined || typeof prism.county_id === "string") &&
|
|
41
43
|
(prism.school_district_id === undefined || typeof prism.school_district_id === "string") &&
|
|
42
|
-
(prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id))
|
|
44
|
+
(prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id)) &&
|
|
45
|
+
Array.isArray(prism.target_ids) && prism.target_ids.every((target_id : any) => typeof target_id === "string")
|
|
43
46
|
)
|
|
44
47
|
}
|
|
45
48
|
}
|