triangle-types 1.0.183 → 1.0.184

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.
@@ -10,6 +10,7 @@ export declare class Prism {
10
10
  readonly county_id?: string;
11
11
  readonly school_district_id?: string;
12
12
  readonly party_type_ids?: VoterPartyTypeID[];
13
+ readonly target_ids: string[];
13
14
  readonly [x: string]: any;
14
15
  constructor(prism: any);
15
16
  static is(prism: any): prism is Prism;
@@ -10,6 +10,7 @@ export class Prism {
10
10
  county_id;
11
11
  school_district_id;
12
12
  party_type_ids;
13
+ target_ids;
13
14
  constructor(prism) {
14
15
  if (!Prism.is(prism)) {
15
16
  throw Error("Invalid input.");
@@ -23,6 +24,7 @@ export class Prism {
23
24
  this.county_id = prism.county_id;
24
25
  this.school_district_id = prism.school_district_id;
25
26
  this.party_type_ids = prism.party_type_ids;
27
+ this.target_ids = prism.target_ids;
26
28
  }
27
29
  static is(prism) {
28
30
  return (prism !== undefined &&
@@ -34,6 +36,7 @@ export class Prism {
34
36
  (prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
35
37
  (prism.county_id === undefined || typeof prism.county_id === "string") &&
36
38
  (prism.school_district_id === undefined || typeof prism.school_district_id === "string") &&
37
- (prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id)));
39
+ (prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id)) &&
40
+ Array.isArray(prism.target_ids) && prism.target_ids.every((target_id) => typeof target_id === "string"));
38
41
  }
39
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.183",
3
+ "version": "1.0.184",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -11,6 +11,7 @@ export class Prism {
11
11
  readonly county_id? : string
12
12
  readonly school_district_id? : string
13
13
  readonly party_type_ids? : VoterPartyTypeID[]
14
+ readonly target_ids : string[]
14
15
  readonly [x : string] : any
15
16
 
16
17
  constructor(prism : any) {
@@ -26,6 +27,7 @@ export class Prism {
26
27
  this.county_id = prism.county_id
27
28
  this.school_district_id = prism.school_district_id
28
29
  this.party_type_ids = prism.party_type_ids
30
+ this.target_ids = prism.target_ids
29
31
  }
30
32
 
31
33
  static is(prism : any) : prism is Prism {
@@ -39,7 +41,8 @@ export class Prism {
39
41
  (prism.state_legislature_senate_district_id === undefined || typeof prism.state_legislature_senate_district_id === "string") &&
40
42
  (prism.county_id === undefined || typeof prism.county_id === "string") &&
41
43
  (prism.school_district_id === undefined || typeof prism.school_district_id === "string") &&
42
- (prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id))
44
+ (prism.party_type_ids === undefined || Array.isArray(prism.party_type_ids) && prism.party_type_ids.every(is_voter_party_type_id)) &&
45
+ Array.isArray(prism.target_ids) && prism.target_ids.every((target_id : any) => typeof target_id === "string")
43
46
  )
44
47
  }
45
48
  }