triangle-types 1.0.250 → 1.0.252

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,3 +1,4 @@
1
+ import { BallotpediaPerson } from "../ballotpedia/BallotpediaPerson.js";
1
2
  import { FederalCongressMember } from "../federal_congress/FederalCongressMember.js";
2
3
  import { FederalElectionCandidate } from "../federal_elections/FederalElectionCandidate.js";
3
4
  export declare class Scout {
@@ -11,6 +12,7 @@ export declare class Scout {
11
12
  export declare class ScoutAux extends Scout {
12
13
  readonly federal_election_candidates: FederalElectionCandidate[];
13
14
  readonly federal_congress_member?: FederalCongressMember;
15
+ readonly ballotpedia_person: BallotpediaPerson;
14
16
  constructor(scout: any);
15
17
  static is(scout: any): scout is ScoutAux;
16
18
  }
@@ -1,3 +1,4 @@
1
+ import { BallotpediaPerson } from "../ballotpedia/BallotpediaPerson.js";
1
2
  import { FederalCongressMember } from "../federal_congress/FederalCongressMember.js";
2
3
  import { FederalElectionCandidate } from "../federal_elections/FederalElectionCandidate.js";
3
4
  // const scout_type_ids = ["I", "O"] as const
@@ -28,7 +29,7 @@ export class Scout {
28
29
  typeof scout.scout_id === "string" &&
29
30
  // is_scout_type_id(scout.scout_type_id) &&
30
31
  // (scout.name === undefined || typeof scout.name === "string") &&
31
- typeof scout.ballotpedia_person_id === "string" &&
32
+ typeof scout.ballotpedia_person_id === "number" &&
32
33
  // (scout.wikipedia_article_id === undefined || typeof scout.wikipedia_article_id === "string") &&
33
34
  (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string"));
34
35
  }
@@ -36,6 +37,7 @@ export class Scout {
36
37
  export class ScoutAux extends Scout {
37
38
  federal_election_candidates;
38
39
  federal_congress_member;
40
+ ballotpedia_person;
39
41
  constructor(scout) {
40
42
  if (!ScoutAux.is(scout)) {
41
43
  throw Error("Invalid input.");
@@ -43,11 +45,13 @@ export class ScoutAux extends Scout {
43
45
  super(scout);
44
46
  this.federal_election_candidates = scout.federal_election_candidates;
45
47
  this.federal_congress_member = scout.federal_congress_member;
48
+ this.ballotpedia_person = scout.ballotpedia_person;
46
49
  }
47
50
  static is(scout) {
48
51
  return (Scout.is(scout) &&
49
52
  Array.isArray(scout.federal_election_candidates) && scout.federal_election_candidates.every(FederalElectionCandidate.is) &&
50
- (scout.federal_congress_member === undefined || FederalCongressMember.is(scout.federal_congress_member)));
53
+ (scout.federal_congress_member === undefined || FederalCongressMember.is(scout.federal_congress_member)) &&
54
+ BallotpediaPerson.is(scout.ballotpedia_person));
51
55
  }
52
56
  }
53
57
  // const scout_office_ids = ["USP", "USH", "USS", "STG", "STH", "STS"] as const
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.250",
3
+ "version": "1.0.252",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,3 +1,4 @@
1
+ import { BallotpediaPerson } from "../ballotpedia/BallotpediaPerson"
1
2
  import { FederalCongressMember } from "../federal_congress/FederalCongressMember"
2
3
  import { FederalElectionCandidate } from "../federal_elections/FederalElectionCandidate"
3
4
  import { DocumentTypeID, is_document_type_id } from "../fragments/Fragment"
@@ -38,7 +39,7 @@ export class Scout {
38
39
  typeof scout.scout_id === "string" &&
39
40
  // is_scout_type_id(scout.scout_type_id) &&
40
41
  // (scout.name === undefined || typeof scout.name === "string") &&
41
- typeof scout.ballotpedia_person_id === "string" &&
42
+ typeof scout.ballotpedia_person_id === "number" &&
42
43
  // (scout.wikipedia_article_id === undefined || typeof scout.wikipedia_article_id === "string") &&
43
44
  (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")
44
45
  )
@@ -48,6 +49,7 @@ export class Scout {
48
49
  export class ScoutAux extends Scout {
49
50
  readonly federal_election_candidates : FederalElectionCandidate[]
50
51
  readonly federal_congress_member? : FederalCongressMember
52
+ readonly ballotpedia_person : BallotpediaPerson
51
53
 
52
54
  constructor(scout : any) {
53
55
  if (!ScoutAux.is(scout)) {
@@ -56,13 +58,15 @@ export class ScoutAux extends Scout {
56
58
  super(scout)
57
59
  this.federal_election_candidates = scout.federal_election_candidates
58
60
  this.federal_congress_member = scout.federal_congress_member
61
+ this.ballotpedia_person = scout.ballotpedia_person
59
62
  }
60
63
 
61
64
  static is(scout : any) : scout is ScoutAux {
62
65
  return (
63
66
  Scout.is(scout) &&
64
67
  Array.isArray(scout.federal_election_candidates) && scout.federal_election_candidates.every(FederalElectionCandidate.is) &&
65
- (scout.federal_congress_member === undefined || FederalCongressMember.is(scout.federal_congress_member))
68
+ (scout.federal_congress_member === undefined || FederalCongressMember.is(scout.federal_congress_member)) &&
69
+ BallotpediaPerson.is(scout.ballotpedia_person)
66
70
  )
67
71
  }
68
72
  }