elections-types 1.0.83 → 1.0.85
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.
- package/dist/src/types/FECFile.d.ts +1 -1
- package/dist/src/types/FECFile.js +3 -3
- package/dist/src/types/State.d.ts +1 -1
- package/dist/src/types/State.js +5 -1
- package/dist/src/types/Video.d.ts +1 -1
- package/dist/src/types/Video.js +3 -3
- package/package.json +1 -1
- package/src/types/FECFile.ts +3 -3
- package/src/types/State.ts +5 -1
- package/src/types/Video.ts +3 -3
|
@@ -8,7 +8,7 @@ export declare class FECFile {
|
|
|
8
8
|
readonly form_type_id: FormTypeID;
|
|
9
9
|
readonly amendment_type_id: AmendmentTypeID;
|
|
10
10
|
readonly long_form_type_id: LongFormTypeID;
|
|
11
|
-
readonly
|
|
11
|
+
readonly s3_id: string;
|
|
12
12
|
[x: string]: any;
|
|
13
13
|
constructor(fec_file: any);
|
|
14
14
|
static is(fec_file: any): fec_file is FECFile;
|
|
@@ -9,7 +9,7 @@ export class FECFile {
|
|
|
9
9
|
form_type_id;
|
|
10
10
|
amendment_type_id;
|
|
11
11
|
long_form_type_id;
|
|
12
|
-
|
|
12
|
+
s3_id;
|
|
13
13
|
constructor(fec_file) {
|
|
14
14
|
if (!FECFile.is(fec_file)) {
|
|
15
15
|
throw Error("Invalid input.");
|
|
@@ -19,7 +19,7 @@ export class FECFile {
|
|
|
19
19
|
this.form_type_id = fec_file.form_type_id;
|
|
20
20
|
this.amendment_type_id = fec_file.amendment_type_id;
|
|
21
21
|
this.long_form_type_id = fec_file.long_form_type_id;
|
|
22
|
-
this.
|
|
22
|
+
this.s3_id = fec_file.s3_id;
|
|
23
23
|
}
|
|
24
24
|
static is(fec_file) {
|
|
25
25
|
return (fec_file !== undefined &&
|
|
@@ -28,6 +28,6 @@ export class FECFile {
|
|
|
28
28
|
is_form_type_id(fec_file.form_type_id) &&
|
|
29
29
|
is_amendment_type_id(fec_file.amendment_type_id) &&
|
|
30
30
|
is_long_form_type_id(fec_file.long_form_type_id) &&
|
|
31
|
-
(fec_file.
|
|
31
|
+
(fec_file.s3_id === undefined || typeof fec_file.s3_id === "string"));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -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/dist/src/types/Video.js
CHANGED
|
@@ -9,7 +9,7 @@ export class Video {
|
|
|
9
9
|
tags;
|
|
10
10
|
duration;
|
|
11
11
|
fetch_time;
|
|
12
|
-
|
|
12
|
+
s3_id;
|
|
13
13
|
constructor(video) {
|
|
14
14
|
if (!Video.is(video)) {
|
|
15
15
|
throw Error("Invalid input.");
|
|
@@ -24,7 +24,7 @@ export class Video {
|
|
|
24
24
|
this.tags = video.tags;
|
|
25
25
|
this.duration = video.duration;
|
|
26
26
|
this.fetch_time = video.fetch_time;
|
|
27
|
-
this.
|
|
27
|
+
this.s3_id = video.s3_id;
|
|
28
28
|
}
|
|
29
29
|
static is(video) {
|
|
30
30
|
return (video !== undefined &&
|
|
@@ -38,6 +38,6 @@ export class Video {
|
|
|
38
38
|
(video.tags === undefined || Array.isArray(video.tags) && video.tags.map((tag) => typeof tag === "string")) &&
|
|
39
39
|
(video.duration === undefined || typeof video.duration === "number" && !isNaN(video.duration)) &&
|
|
40
40
|
typeof video.fetch_time === "string" &&
|
|
41
|
-
(video.
|
|
41
|
+
(video.s3_id === undefined || typeof video.s3_id === "string"));
|
|
42
42
|
}
|
|
43
43
|
}
|
package/package.json
CHANGED
package/src/types/FECFile.ts
CHANGED
|
@@ -14,7 +14,7 @@ export class FECFile {
|
|
|
14
14
|
readonly form_type_id : FormTypeID
|
|
15
15
|
readonly amendment_type_id : AmendmentTypeID
|
|
16
16
|
readonly long_form_type_id : LongFormTypeID
|
|
17
|
-
readonly
|
|
17
|
+
readonly s3_id : string
|
|
18
18
|
[x : string] : any
|
|
19
19
|
|
|
20
20
|
constructor(fec_file : any) {
|
|
@@ -26,7 +26,7 @@ export class FECFile {
|
|
|
26
26
|
this.form_type_id = fec_file.form_type_id
|
|
27
27
|
this.amendment_type_id = fec_file.amendment_type_id
|
|
28
28
|
this.long_form_type_id = fec_file.long_form_type_id
|
|
29
|
-
this.
|
|
29
|
+
this.s3_id = fec_file.s3_id
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
static is(fec_file : any) : fec_file is FECFile {
|
|
@@ -37,7 +37,7 @@ export class FECFile {
|
|
|
37
37
|
is_form_type_id(fec_file.form_type_id) &&
|
|
38
38
|
is_amendment_type_id(fec_file.amendment_type_id) &&
|
|
39
39
|
is_long_form_type_id(fec_file.long_form_type_id) &&
|
|
40
|
-
(fec_file.
|
|
40
|
+
(fec_file.s3_id === undefined || typeof fec_file.s3_id === "string")
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
}
|
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"
|
package/src/types/Video.ts
CHANGED
|
@@ -9,7 +9,7 @@ export class Video {
|
|
|
9
9
|
readonly tags? : string[]
|
|
10
10
|
readonly duration? : number
|
|
11
11
|
readonly fetch_time : string
|
|
12
|
-
readonly
|
|
12
|
+
readonly s3_id? : string
|
|
13
13
|
|
|
14
14
|
constructor(video : Video) {
|
|
15
15
|
if (!Video.is(video)) {
|
|
@@ -25,7 +25,7 @@ export class Video {
|
|
|
25
25
|
this.tags = video.tags
|
|
26
26
|
this.duration = video.duration
|
|
27
27
|
this.fetch_time = video.fetch_time
|
|
28
|
-
this.
|
|
28
|
+
this.s3_id = video.s3_id
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
static is(video : any) : video is Video {
|
|
@@ -41,7 +41,7 @@ export class Video {
|
|
|
41
41
|
(video.tags === undefined || Array.isArray(video.tags) && video.tags.map((tag : any) => typeof tag === "string")) &&
|
|
42
42
|
(video.duration === undefined || typeof video.duration === "number" && !isNaN(video.duration)) &&
|
|
43
43
|
typeof video.fetch_time === "string" &&
|
|
44
|
-
(video.
|
|
44
|
+
(video.s3_id === undefined || typeof video.s3_id === "string")
|
|
45
45
|
)
|
|
46
46
|
}
|
|
47
47
|
}
|