elections-types 1.0.68 → 1.0.69
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.
|
@@ -12,7 +12,6 @@ export declare class Election {
|
|
|
12
12
|
readonly office_id: OfficeID;
|
|
13
13
|
readonly state_id: StateID;
|
|
14
14
|
readonly district?: number;
|
|
15
|
-
readonly committee_ids?: string[];
|
|
16
15
|
readonly [x: string]: any;
|
|
17
16
|
constructor(election: Election);
|
|
18
17
|
static is(election: any): election is Election;
|
|
@@ -25,7 +25,6 @@ export class Election {
|
|
|
25
25
|
office_id;
|
|
26
26
|
state_id;
|
|
27
27
|
district;
|
|
28
|
-
committee_ids;
|
|
29
28
|
constructor(election) {
|
|
30
29
|
if (!Election.is(election)) {
|
|
31
30
|
throw Error("Invalid input.");
|
|
@@ -35,7 +34,6 @@ export class Election {
|
|
|
35
34
|
this.office_id = election.office_id;
|
|
36
35
|
this.state_id = election.state_id;
|
|
37
36
|
this.district = election.district;
|
|
38
|
-
this.committee_ids = election.committee_ids;
|
|
39
37
|
}
|
|
40
38
|
static is(election) {
|
|
41
39
|
return (election !== undefined &&
|
|
@@ -43,8 +41,7 @@ export class Election {
|
|
|
43
41
|
typeof election.name === "string" &&
|
|
44
42
|
is_office_id(election.office_id) &&
|
|
45
43
|
is_state_id(election.state_id) &&
|
|
46
|
-
(election.district === undefined || typeof election.district === "number")
|
|
47
|
-
(election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id) => typeof committee_id === "string")));
|
|
44
|
+
(election.district === undefined || typeof election.district === "number"));
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
47
|
export class ElectionAux extends Election {
|
package/package.json
CHANGED
package/src/types/Election.ts
CHANGED
|
@@ -36,7 +36,6 @@ export class Election {
|
|
|
36
36
|
readonly office_id : OfficeID
|
|
37
37
|
readonly state_id : StateID
|
|
38
38
|
readonly district? : number
|
|
39
|
-
readonly committee_ids? : string[]
|
|
40
39
|
readonly [x : string] : any
|
|
41
40
|
|
|
42
41
|
constructor(election : Election) {
|
|
@@ -48,7 +47,6 @@ export class Election {
|
|
|
48
47
|
this.office_id = election.office_id
|
|
49
48
|
this.state_id = election.state_id
|
|
50
49
|
this.district = election.district
|
|
51
|
-
this.committee_ids = election.committee_ids
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
static is(election : any) : election is Election {
|
|
@@ -58,8 +56,7 @@ export class Election {
|
|
|
58
56
|
typeof election.name === "string" &&
|
|
59
57
|
is_office_id(election.office_id) &&
|
|
60
58
|
is_state_id(election.state_id) &&
|
|
61
|
-
(election.district === undefined || typeof election.district === "number")
|
|
62
|
-
(election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id : any) => typeof committee_id === "string"))
|
|
59
|
+
(election.district === undefined || typeof election.district === "number")
|
|
63
60
|
)
|
|
64
61
|
}
|
|
65
62
|
}
|