scout-types 1.0.14 → 1.0.16
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,12 +8,12 @@ export declare class Scout {
|
|
|
8
8
|
readonly scout_id: string;
|
|
9
9
|
readonly name: string;
|
|
10
10
|
readonly active: boolean;
|
|
11
|
-
readonly state_id
|
|
11
|
+
readonly state_id?: StateID;
|
|
12
12
|
readonly district?: number;
|
|
13
13
|
readonly party_id: PartyID;
|
|
14
14
|
readonly tone_description_refresh: boolean;
|
|
15
15
|
readonly jurisdiction_ids: number[];
|
|
16
|
-
readonly sub_scout_ids
|
|
16
|
+
readonly sub_scout_ids?: string[];
|
|
17
17
|
readonly office_class_id: OfficeClassID;
|
|
18
18
|
readonly office_name?: string;
|
|
19
19
|
readonly [x: string]: any;
|
|
@@ -22,7 +22,7 @@ export declare class Scout {
|
|
|
22
22
|
}
|
|
23
23
|
export declare class ScoutAux extends Scout {
|
|
24
24
|
readonly jurisdictions: Jurisdiction[];
|
|
25
|
-
readonly sub_scouts
|
|
25
|
+
readonly sub_scouts?: Scout[];
|
|
26
26
|
readonly photo_download_url?: string;
|
|
27
27
|
readonly tone_description?: string;
|
|
28
28
|
constructor(scout: any);
|
package/dist/src/types/Scout.js
CHANGED
|
@@ -41,14 +41,13 @@ export class Scout {
|
|
|
41
41
|
typeof scout.scout_id === "string" &&
|
|
42
42
|
typeof scout.name === "string" &&
|
|
43
43
|
typeof scout.active === "boolean" &&
|
|
44
|
-
is_state_id(scout.state_id) &&
|
|
44
|
+
(scout.state_id === undefined || is_state_id(scout.state_id)) &&
|
|
45
45
|
(scout.district === undefined || typeof scout.district === "number") &&
|
|
46
46
|
is_party_id(scout.party_id) &&
|
|
47
47
|
typeof scout.tone_description_refresh === "boolean" &&
|
|
48
48
|
Array.isArray(scout.jurisdiction_ids) &&
|
|
49
49
|
scout.jurisdiction_ids.every((jurisdiction_id) => typeof jurisdiction_id === "number") &&
|
|
50
|
-
Array.isArray(scout.sub_scout_ids) &&
|
|
51
|
-
scout.sub_scout_ids.every((sub_scout_id) => typeof sub_scout_id === "string") &&
|
|
50
|
+
(scout.sub_scout_ids || Array.isArray(scout.sub_scout_ids) && scout.sub_scout_ids.every((sub_scout_id) => typeof sub_scout_id === "string")) &&
|
|
52
51
|
is_office_class_id(scout.office_class_id) &&
|
|
53
52
|
(scout.office_name === undefined || typeof scout.office_name === "string"));
|
|
54
53
|
}
|
|
@@ -72,8 +71,7 @@ export class ScoutAux extends Scout {
|
|
|
72
71
|
return (Scout.is(scout) &&
|
|
73
72
|
Array.isArray(scout.jurisdictions) &&
|
|
74
73
|
scout.jurisdictions.every(Jurisdiction.is) &&
|
|
75
|
-
Array.isArray(scout.sub_scouts) &&
|
|
76
|
-
scout.sub_scouts.every(Scout.is) &&
|
|
74
|
+
(scout.sub_scouts === undefined || Array.isArray(scout.sub_scouts) && scout.sub_scouts.every(Scout.is)) &&
|
|
77
75
|
(scout.photo_download_url === undefined || typeof scout.photo_download_url === "string") &&
|
|
78
76
|
(scout.tone_description === undefined || typeof scout.tone_description === "string"));
|
|
79
77
|
}
|
package/package.json
CHANGED
package/src/types/Scout.ts
CHANGED
|
@@ -9,12 +9,12 @@ export class Scout {
|
|
|
9
9
|
readonly scout_id : string
|
|
10
10
|
readonly name : string
|
|
11
11
|
readonly active : boolean
|
|
12
|
-
readonly state_id : StateID
|
|
12
|
+
readonly state_id? : StateID
|
|
13
13
|
readonly district? : number
|
|
14
14
|
readonly party_id : PartyID
|
|
15
15
|
readonly tone_description_refresh : boolean
|
|
16
16
|
readonly jurisdiction_ids : number[]
|
|
17
|
-
readonly sub_scout_ids : string[]
|
|
17
|
+
readonly sub_scout_ids? : string[]
|
|
18
18
|
readonly office_class_id : OfficeClassID
|
|
19
19
|
readonly office_name? : string
|
|
20
20
|
readonly [x : string] : any
|
|
@@ -46,14 +46,13 @@ export class Scout {
|
|
|
46
46
|
typeof scout.scout_id === "string" &&
|
|
47
47
|
typeof scout.name === "string" &&
|
|
48
48
|
typeof scout.active === "boolean" &&
|
|
49
|
-
is_state_id(scout.state_id) &&
|
|
49
|
+
(scout.state_id === undefined || is_state_id(scout.state_id)) &&
|
|
50
50
|
(scout.district === undefined || typeof scout.district === "number") &&
|
|
51
51
|
is_party_id(scout.party_id) &&
|
|
52
52
|
typeof scout.tone_description_refresh === "boolean" &&
|
|
53
53
|
Array.isArray(scout.jurisdiction_ids) &&
|
|
54
54
|
scout.jurisdiction_ids.every((jurisdiction_id : any) => typeof jurisdiction_id === "number") &&
|
|
55
|
-
Array.isArray(scout.sub_scout_ids) &&
|
|
56
|
-
scout.sub_scout_ids.every((sub_scout_id : any) => typeof sub_scout_id === "string") &&
|
|
55
|
+
(scout.sub_scout_ids || Array.isArray(scout.sub_scout_ids) && scout.sub_scout_ids.every((sub_scout_id : any) => typeof sub_scout_id === "string")) &&
|
|
57
56
|
is_office_class_id(scout.office_class_id) &&
|
|
58
57
|
(scout.office_name === undefined || typeof scout.office_name === "string")
|
|
59
58
|
)
|
|
@@ -62,7 +61,7 @@ export class Scout {
|
|
|
62
61
|
|
|
63
62
|
export class ScoutAux extends Scout {
|
|
64
63
|
readonly jurisdictions : Jurisdiction[]
|
|
65
|
-
readonly sub_scouts : Scout[]
|
|
64
|
+
readonly sub_scouts? : Scout[]
|
|
66
65
|
readonly photo_download_url? : string
|
|
67
66
|
readonly tone_description? : string
|
|
68
67
|
|
|
@@ -82,8 +81,7 @@ export class ScoutAux extends Scout {
|
|
|
82
81
|
Scout.is(scout) &&
|
|
83
82
|
Array.isArray(scout.jurisdictions) &&
|
|
84
83
|
scout.jurisdictions.every(Jurisdiction.is) &&
|
|
85
|
-
Array.isArray(scout.sub_scouts) &&
|
|
86
|
-
scout.sub_scouts.every(Scout.is) &&
|
|
84
|
+
(scout.sub_scouts === undefined || Array.isArray(scout.sub_scouts) && scout.sub_scouts.every(Scout.is)) &&
|
|
87
85
|
(scout.photo_download_url === undefined || typeof scout.photo_download_url === "string") &&
|
|
88
86
|
(scout.tone_description === undefined || typeof scout.tone_description === "string")
|
|
89
87
|
)
|