elections-types 1.0.21 → 1.0.23

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.
@@ -1,4 +1,4 @@
1
- export declare const designations: readonly ["F1", "F2", "F3", "F24"];
1
+ export declare const designations: readonly ["P", "A", "U", "J", "D", "B"];
2
2
  export type CommitteeDesignation = typeof designations[number];
3
3
  export declare function is_committee_designation(designation: any): designation is CommitteeDesignation;
4
4
  export declare class Committee {
@@ -1,4 +1,4 @@
1
- export const designations = ["F1", "F2", "F3", "F24"];
1
+ export const designations = ["P", "A", "U", "J", "D", "B"];
2
2
  export function is_committee_designation(designation) {
3
3
  return designations.includes(designation);
4
4
  }
@@ -37,10 +37,10 @@ export class Committee {
37
37
  static is(committee) {
38
38
  return (committee !== undefined &&
39
39
  typeof committee.committee_id === "string" &&
40
- (committee.name === undefined || typeof committee.name === "string") &&
40
+ typeof committee.name === "string" &&
41
41
  (committee.url === undefined || typeof committee.url === "string") &&
42
42
  is_committee_designation(committee.designation) &&
43
- typeof committee.file_number === "number" && !isNaN(committee.file_number) &&
43
+ (committee.file_number === undefined || typeof committee.file_number === "number" && !isNaN(committee.file_number)) &&
44
44
  (committee.principal_committee_ids === undefined || Array.isArray(committee.principal_committee_ids) && committee.principal_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
45
45
  (committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
46
46
  (committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((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.21",
3
+ "version": "1.0.23",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -1,4 +1,4 @@
1
- export const designations = ["F1", "F2", "F3", "F24"] as const
1
+ export const designations = ["P", "A", "U", "J", "D", "B"] as const
2
2
 
3
3
  export type CommitteeDesignation = typeof designations[number]
4
4
 
@@ -45,10 +45,10 @@ export class Committee {
45
45
  return (
46
46
  committee !== undefined &&
47
47
  typeof committee.committee_id === "string" &&
48
- (committee.name === undefined || typeof committee.name === "string") &&
48
+ typeof committee.name === "string" &&
49
49
  (committee.url === undefined || typeof committee.url === "string") &&
50
50
  is_committee_designation(committee.designation) &&
51
- typeof committee.file_number === "number" && !isNaN(committee.file_number) &&
51
+ (committee.file_number === undefined || typeof committee.file_number === "number" && !isNaN(committee.file_number)) &&
52
52
  (committee.principal_committee_ids === undefined || Array.isArray(committee.principal_committee_ids) && committee.principal_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
53
53
  (committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
54
54
  (committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&