triangle-types 1.0.123 → 1.0.125
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/federal_elections/FederalElection.d.ts +2 -2
- package/dist/src/types/federal_elections/FederalElection.js +2 -2
- package/dist/src/types/scout/Scout.d.ts +0 -2
- package/dist/src/types/scout/Scout.js +1 -5
- package/package.json +1 -1
- package/src/types/federal_elections/FederalElection.ts +2 -2
- package/src/types/scout/Scout.ts +1 -4
|
@@ -2,9 +2,10 @@ import { FederalElectionCandidateAux } from "./FederalElectionCandidate.js";
|
|
|
2
2
|
import { FederalElectionCommitteeAux } from "./FederalElectionCommittee.js";
|
|
3
3
|
import { FederalElectionFileExpenditureAux } from "./FederalElectionFileExpenditure.js";
|
|
4
4
|
import { StateID } from "../regions/State.js";
|
|
5
|
-
declare const federal_election_office_ids: readonly ["H", "S", "P"];
|
|
5
|
+
export declare const federal_election_office_ids: readonly ["H", "S", "P"];
|
|
6
6
|
export type FederalElectionOfficeID = typeof federal_election_office_ids[number];
|
|
7
7
|
export declare function is_federal_election_office_id(federal_election_office_id: any): federal_election_office_id is FederalElectionOfficeID;
|
|
8
|
+
export declare const state_ids_without_district: StateID[];
|
|
8
9
|
export type FederalElectionID = string;
|
|
9
10
|
export declare function is_federal_election_id(federal_election_id: any): federal_election_id is FederalElectionID;
|
|
10
11
|
export declare class FederalElection {
|
|
@@ -24,4 +25,3 @@ export declare class FederalElectionAux extends FederalElection {
|
|
|
24
25
|
constructor(federal_election: any);
|
|
25
26
|
static is(federal_election: any): federal_election is FederalElectionAux;
|
|
26
27
|
}
|
|
27
|
-
export {};
|
|
@@ -2,11 +2,11 @@ import { FederalElectionCandidateAux } from "./FederalElectionCandidate.js";
|
|
|
2
2
|
import { FederalElectionCommitteeAux } from "./FederalElectionCommittee.js";
|
|
3
3
|
import { FederalElectionFileExpenditureAux } from "./FederalElectionFileExpenditure.js";
|
|
4
4
|
import { is_state_id } from "../regions/State.js";
|
|
5
|
-
const federal_election_office_ids = ["H", "S", "P"];
|
|
5
|
+
export const federal_election_office_ids = ["H", "S", "P"];
|
|
6
6
|
export function is_federal_election_office_id(federal_election_office_id) {
|
|
7
7
|
return federal_election_office_ids.includes(federal_election_office_id);
|
|
8
8
|
}
|
|
9
|
-
const state_ids_without_district = ["AK", "DE", "ND", "SD", "VT", "WY"];
|
|
9
|
+
export const state_ids_without_district = ["AK", "DE", "ND", "SD", "VT", "WY"];
|
|
10
10
|
export function is_federal_election_id(federal_election_id) {
|
|
11
11
|
const parts = federal_election_id.split("-");
|
|
12
12
|
const year = Number(parts[0]);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { DocumentTypeID } from "../fragments/Fragment.js";
|
|
2
1
|
export declare class Scout {
|
|
3
2
|
readonly scout_id: string;
|
|
4
3
|
readonly name: string;
|
|
5
4
|
readonly s3_id_img?: string;
|
|
6
|
-
readonly document_type_ids: DocumentTypeID[];
|
|
7
5
|
readonly [x: string]: any;
|
|
8
6
|
constructor(scout: any);
|
|
9
7
|
static is(scout: any): scout is Scout;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { is_document_type_id } from "../fragments/Fragment.js";
|
|
2
1
|
// const scout_type_ids = ["I", "O"] as const
|
|
3
2
|
// export type ScoutTypeID = typeof scout_type_ids[number]
|
|
4
3
|
// export function is_scout_type_id(scout_type_id : any) : scout_type_id is ScoutTypeID {
|
|
@@ -9,7 +8,6 @@ export class Scout {
|
|
|
9
8
|
// readonly scout_type_id : ScoutTypeID
|
|
10
9
|
name;
|
|
11
10
|
s3_id_img;
|
|
12
|
-
document_type_ids;
|
|
13
11
|
constructor(scout) {
|
|
14
12
|
if (!Scout.is(scout)) {
|
|
15
13
|
throw Error("Invalid input.");
|
|
@@ -18,15 +16,13 @@ export class Scout {
|
|
|
18
16
|
// this.scout_type_id = scout.scout_type_id
|
|
19
17
|
this.name = scout.name;
|
|
20
18
|
this.s3_id_img = scout.s3_id_img;
|
|
21
|
-
this.document_type_ids = scout.document_type_ids;
|
|
22
19
|
}
|
|
23
20
|
static is(scout) {
|
|
24
21
|
return (scout !== undefined &&
|
|
25
22
|
typeof scout.scout_id === "string" &&
|
|
26
23
|
// is_scout_type_id(scout.scout_type_id) &&
|
|
27
24
|
typeof scout.name === "string" &&
|
|
28
|
-
(scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")
|
|
29
|
-
Array.isArray(scout.document_type_ids) && scout.document_type_ids.every(is_document_type_id));
|
|
25
|
+
(scout.s3_id_img === undefined || typeof scout.s3_id_img === "string"));
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
28
|
export class ScoutAux extends Scout {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import { FederalElectionCommitteeAux } from "./FederalElectionCommittee"
|
|
|
3
3
|
import { FederalElectionFileExpenditureAux } from "./FederalElectionFileExpenditure"
|
|
4
4
|
import { is_state_id, StateID } from "../regions/State"
|
|
5
5
|
|
|
6
|
-
const federal_election_office_ids = ["H", "S", "P"] as const
|
|
6
|
+
export const federal_election_office_ids = ["H", "S", "P"] as const
|
|
7
7
|
|
|
8
8
|
export type FederalElectionOfficeID = typeof federal_election_office_ids[number]
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ export function is_federal_election_office_id(federal_election_office_id : any)
|
|
|
11
11
|
return federal_election_office_ids.includes(federal_election_office_id)
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const state_ids_without_district : StateID[] = ["AK", "DE", "ND", "SD", "VT", "WY"]
|
|
14
|
+
export const state_ids_without_district : StateID[] = ["AK", "DE", "ND", "SD", "VT", "WY"]
|
|
15
15
|
|
|
16
16
|
export type FederalElectionID = string
|
|
17
17
|
|
package/src/types/scout/Scout.ts
CHANGED
|
@@ -14,7 +14,6 @@ export class Scout {
|
|
|
14
14
|
// readonly scout_type_id : ScoutTypeID
|
|
15
15
|
readonly name : string
|
|
16
16
|
readonly s3_id_img? : string
|
|
17
|
-
readonly document_type_ids : DocumentTypeID[]
|
|
18
17
|
readonly [x : string] : any
|
|
19
18
|
|
|
20
19
|
constructor(scout : any) {
|
|
@@ -25,7 +24,6 @@ export class Scout {
|
|
|
25
24
|
// this.scout_type_id = scout.scout_type_id
|
|
26
25
|
this.name = scout.name
|
|
27
26
|
this.s3_id_img = scout.s3_id_img
|
|
28
|
-
this.document_type_ids = scout.document_type_ids
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
static is(scout : any) : scout is Scout {
|
|
@@ -34,8 +32,7 @@ export class Scout {
|
|
|
34
32
|
typeof scout.scout_id === "string" &&
|
|
35
33
|
// is_scout_type_id(scout.scout_type_id) &&
|
|
36
34
|
typeof scout.name === "string" &&
|
|
37
|
-
(scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")
|
|
38
|
-
Array.isArray(scout.document_type_ids) && scout.document_type_ids.every(is_document_type_id)
|
|
35
|
+
(scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")
|
|
39
36
|
)
|
|
40
37
|
}
|
|
41
38
|
}
|