elections-types 1.0.15 → 1.0.17

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.
@@ -13,10 +13,10 @@ export declare class Candidate {
13
13
  readonly office_id: OfficeID;
14
14
  readonly state_id: StateID;
15
15
  readonly election_id: ElectionID;
16
- readonly party_id: string;
16
+ readonly party_id?: string;
17
17
  readonly active: boolean;
18
18
  readonly status: string;
19
- readonly file_number: number;
19
+ readonly file_number?: number;
20
20
  readonly committee_ids?: string[];
21
21
  readonly principal_committee_ids?: string[];
22
22
  readonly authorized_committee_ids?: string[];
@@ -68,10 +68,10 @@ export class Candidate {
68
68
  is_office_id(candidate.office_id) &&
69
69
  is_state_id(candidate.state_id) &&
70
70
  is_election_id(candidate.election_id) &&
71
- typeof candidate.party_id === "string" &&
71
+ (candidate.party_id === undefined || typeof candidate.party_id === "string") &&
72
72
  typeof candidate.active === "boolean" &&
73
73
  typeof candidate.status === "string" &&
74
- typeof candidate.file_number === "number" &&
74
+ (candidate.file_number === undefined || typeof candidate.file_number === "number") &&
75
75
  (candidate.committee_id === undefined || Array.isArray(candidate.committee_id) && candidate.committee_id.map((committee_id) => typeof committee_id === "string")) &&
76
76
  (candidate.principal_committee_ids === undefined || Array.isArray(candidate.principal_committee_ids) && candidate.principal_committee_ids.map((committee_id) => typeof committee_id === "string")) &&
77
77
  (candidate.authorized_committee_ids === undefined || Array.isArray(candidate.authorized_committee_ids) && candidate.authorized_committee_ids.map((committee_id) => typeof committee_id === "string")) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -31,10 +31,10 @@ export class Candidate {
31
31
  readonly office_id : OfficeID
32
32
  readonly state_id : StateID
33
33
  readonly election_id : ElectionID
34
- readonly party_id : string
35
- readonly active : boolean
36
- readonly status : string
37
- readonly file_number : number
34
+ readonly party_id? : string
35
+ readonly active? : boolean
36
+ readonly status? : string
37
+ readonly file_number? : number
38
38
  readonly committee_ids? : string[]
39
39
  readonly principal_committee_ids? : string[]
40
40
  readonly authorized_committee_ids? : string[]
@@ -78,10 +78,10 @@ export class Candidate {
78
78
  is_office_id(candidate.office_id) &&
79
79
  is_state_id(candidate.state_id) &&
80
80
  is_election_id(candidate.election_id) &&
81
- typeof candidate.party_id === "string" &&
82
- typeof candidate.active === "boolean" &&
83
- typeof candidate.status === "string" &&
84
- typeof candidate.file_number === "number" &&
81
+ (candidate.party_id === undefined || typeof candidate.party_id === "string") &&
82
+ (candidate.active === undefined || typeof candidate.active === "boolean") &&
83
+ (candidate.status === undefined || typeof candidate.status === "string") &&
84
+ (candidate.file_number === undefined || typeof candidate.file_number === "number") &&
85
85
  (candidate.committee_id === undefined || Array.isArray(candidate.committee_id) && candidate.committee_id.map((committee_id : any) => typeof committee_id === "string")) &&
86
86
  (candidate.principal_committee_ids === undefined || Array.isArray(candidate.principal_committee_ids) && candidate.principal_committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
87
87
  (candidate.authorized_committee_ids === undefined || Array.isArray(candidate.authorized_committee_ids) && candidate.authorized_committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&