elections-types 1.0.82 → 1.0.84
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.
|
@@ -8,6 +8,7 @@ export declare class FederalDonation {
|
|
|
8
8
|
readonly fec_file_id: number;
|
|
9
9
|
readonly image_number: string;
|
|
10
10
|
readonly amount: number;
|
|
11
|
+
readonly donor_is_individual: boolean;
|
|
11
12
|
readonly donor_id?: string;
|
|
12
13
|
readonly donor_name: string;
|
|
13
14
|
readonly donor_prefix?: string;
|
|
@@ -7,6 +7,7 @@ export class FederalDonation {
|
|
|
7
7
|
fec_file_id;
|
|
8
8
|
image_number;
|
|
9
9
|
amount;
|
|
10
|
+
donor_is_individual;
|
|
10
11
|
donor_id;
|
|
11
12
|
donor_name;
|
|
12
13
|
donor_prefix;
|
|
@@ -35,6 +36,7 @@ export class FederalDonation {
|
|
|
35
36
|
this.fec_file_id = federal_donation.fec_file_id;
|
|
36
37
|
this.image_number = federal_donation.image_number;
|
|
37
38
|
this.amount = federal_donation.amount;
|
|
39
|
+
this.donor_is_individual = federal_donation.donor_is_individual;
|
|
38
40
|
this.donor_id = federal_donation.donor_id;
|
|
39
41
|
this.donor_name = federal_donation.donor_name;
|
|
40
42
|
this.donor_prefix = federal_donation.donor_prefix;
|
|
@@ -62,6 +64,7 @@ export class FederalDonation {
|
|
|
62
64
|
typeof federal_donation.fec_file_id === "number" && !isNaN(federal_donation.fec_file_id) &&
|
|
63
65
|
typeof federal_donation.image_number === "string" &&
|
|
64
66
|
typeof federal_donation.amount === "number" && !isNaN(federal_donation.amount) &&
|
|
67
|
+
typeof federal_donation.donor_is_individual === "boolean" &&
|
|
65
68
|
(federal_donation.donor_id === undefined || typeof federal_donation.donor_id === "string") &&
|
|
66
69
|
typeof federal_donation.donor_name === "string" &&
|
|
67
70
|
(federal_donation.donor_prefix === undefined || typeof federal_donation.donor_prefix === "string") &&
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const state_ids: readonly ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
|
|
1
|
+
export declare const state_ids: readonly ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
|
|
2
2
|
export type StateID = typeof state_ids[number];
|
|
3
3
|
export declare function is_state_id(state_id: any): state_id is StateID;
|
|
4
4
|
export interface State {
|
package/dist/src/types/State.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const state_ids = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
|
|
1
|
+
export const state_ids = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"];
|
|
2
2
|
export function is_state_id(state_id) {
|
|
3
3
|
return state_ids.includes(state_id);
|
|
4
4
|
}
|
|
@@ -31,6 +31,10 @@ export const states_by_state_id = {
|
|
|
31
31
|
state_id: "CT",
|
|
32
32
|
name: "Connecticut"
|
|
33
33
|
},
|
|
34
|
+
DC: {
|
|
35
|
+
state_id: "DC",
|
|
36
|
+
name: "Washington D.C."
|
|
37
|
+
},
|
|
34
38
|
DE: {
|
|
35
39
|
state_id: "DE",
|
|
36
40
|
name: "Delaware"
|
package/package.json
CHANGED
|
@@ -9,6 +9,7 @@ export class FederalDonation {
|
|
|
9
9
|
readonly fec_file_id : number
|
|
10
10
|
readonly image_number : string
|
|
11
11
|
readonly amount : number
|
|
12
|
+
readonly donor_is_individual : boolean
|
|
12
13
|
readonly donor_id? : string
|
|
13
14
|
readonly donor_name : string
|
|
14
15
|
readonly donor_prefix? : string
|
|
@@ -38,6 +39,7 @@ export class FederalDonation {
|
|
|
38
39
|
this.fec_file_id = federal_donation.fec_file_id
|
|
39
40
|
this.image_number = federal_donation.image_number
|
|
40
41
|
this.amount = federal_donation.amount
|
|
42
|
+
this.donor_is_individual = federal_donation.donor_is_individual
|
|
41
43
|
this.donor_id = federal_donation.donor_id
|
|
42
44
|
this.donor_name = federal_donation.donor_name
|
|
43
45
|
this.donor_prefix = federal_donation.donor_prefix
|
|
@@ -67,6 +69,7 @@ export class FederalDonation {
|
|
|
67
69
|
typeof federal_donation.fec_file_id === "number" && !isNaN(federal_donation.fec_file_id) &&
|
|
68
70
|
typeof federal_donation.image_number === "string" &&
|
|
69
71
|
typeof federal_donation.amount === "number" && !isNaN(federal_donation.amount) &&
|
|
72
|
+
typeof federal_donation.donor_is_individual === "boolean" &&
|
|
70
73
|
(federal_donation.donor_id === undefined || typeof federal_donation.donor_id === "string") &&
|
|
71
74
|
typeof federal_donation.donor_name === "string" &&
|
|
72
75
|
(federal_donation.donor_prefix === undefined || typeof federal_donation.donor_prefix === "string") &&
|
package/src/types/State.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const state_ids = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"] as const
|
|
1
|
+
export const state_ids = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"] as const
|
|
2
2
|
|
|
3
3
|
export type StateID = typeof state_ids[number]
|
|
4
4
|
|
|
@@ -40,6 +40,10 @@ export const states_by_state_id : Record<StateID, State> = {
|
|
|
40
40
|
state_id : "CT",
|
|
41
41
|
name : "Connecticut"
|
|
42
42
|
},
|
|
43
|
+
DC : {
|
|
44
|
+
state_id : "DC",
|
|
45
|
+
name : "Washington D.C."
|
|
46
|
+
},
|
|
43
47
|
DE : {
|
|
44
48
|
state_id : "DE",
|
|
45
49
|
name : "Delaware"
|