volleyballsimtypes 0.0.124 → 0.0.125

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,9 +8,9 @@ function transformToAttributes(team) {
8
8
  team_id: team.id,
9
9
  name: team.name,
10
10
  short_name: team.shortName,
11
- coach_id: team.coach?.id,
12
- country_id: team.country?.id,
13
- league_id: team.league?.id,
11
+ coach_id: team.coach != null ? team.coach.id : undefined,
12
+ country_id: team.country != null ? team.country.id : undefined,
13
+ league_id: team.league != null ? team.league.id : undefined,
14
14
  coach: team.coach != null ? (0, _1.transformFromCoach)(team.coach) : undefined,
15
15
  rating: team.rating
16
16
  };
@@ -21,10 +21,9 @@ function transformToObject(team) {
21
21
  id: team.team_id,
22
22
  name: team.name,
23
23
  shortName: team.short_name,
24
- country: (0, _1.transformToCountry)(team.country),
25
- coach: (0, _1.transformToCoach)(team.coach),
26
- roster: team.PlayerTeams.map(pt => (0, _1.transformToPlayer)(pt.player)),
27
- league: (0, _1.transformToLeague)(team.league),
24
+ country: team.country != null ? (0, _1.transformToCountry)(team.country) : undefined,
25
+ coach: team.coach != null ? (0, _1.transformToCoach)(team.coach) : undefined,
26
+ roster: team.PlayerTeams != null ? team.PlayerTeams.map(pt => (0, _1.transformToPlayer)(pt.player)) : [],
28
27
  rating: team.rating
29
28
  });
30
29
  }
@@ -8,18 +8,18 @@ interface TeamOpts {
8
8
  readonly name: string;
9
9
  readonly shortName: string;
10
10
  readonly roster: Player[];
11
- readonly country: Country;
12
- readonly league: League;
13
- readonly coach: Coach;
11
+ readonly country?: Country;
12
+ readonly league?: League;
13
+ readonly coach?: Coach;
14
14
  }
15
15
  export declare class Team {
16
16
  readonly id: string;
17
17
  readonly roster: Player[];
18
18
  readonly name: string;
19
19
  readonly shortName: string;
20
- readonly coach: Coach;
21
- readonly league: League;
22
- readonly country: Country;
20
+ readonly coach?: Coach;
21
+ readonly league?: League;
22
+ readonly country?: Country;
23
23
  private _rating;
24
24
  constructor({ id, rating, name, shortName, country, roster, coach, league }: TeamOpts);
25
25
  get rating(): number;
@@ -1,13 +1,13 @@
1
1
  import { Team } from '../../service';
2
- import { transformFromCoach, transformToAPICoach, transformToAPIPlayer, transformToCoach, transformToCountry, transformToLeague, transformToPlayer } from '.';
2
+ import { transformFromCoach, transformToAPICoach, transformToAPIPlayer, transformToCoach, transformToCountry, transformToPlayer } from '.';
3
3
  function transformToAttributes(team) {
4
4
  return {
5
5
  team_id: team.id,
6
6
  name: team.name,
7
7
  short_name: team.shortName,
8
- coach_id: team.coach?.id,
9
- country_id: team.country?.id,
10
- league_id: team.league?.id,
8
+ coach_id: team.coach != null ? team.coach.id : undefined,
9
+ country_id: team.country != null ? team.country.id : undefined,
10
+ league_id: team.league != null ? team.league.id : undefined,
11
11
  coach: team.coach != null ? transformFromCoach(team.coach) : undefined,
12
12
  rating: team.rating
13
13
  };
@@ -17,10 +17,9 @@ function transformToObject(team) {
17
17
  id: team.team_id,
18
18
  name: team.name,
19
19
  shortName: team.short_name,
20
- country: transformToCountry(team.country),
21
- coach: transformToCoach(team.coach),
22
- roster: team.PlayerTeams.map(pt => transformToPlayer(pt.player)),
23
- league: transformToLeague(team.league),
20
+ country: team.country != null ? transformToCountry(team.country) : undefined,
21
+ coach: team.coach != null ? transformToCoach(team.coach) : undefined,
22
+ roster: team.PlayerTeams != null ? team.PlayerTeams.map(pt => transformToPlayer(pt.player)) : [],
24
23
  rating: team.rating
25
24
  });
26
25
  }
@@ -8,18 +8,18 @@ interface TeamOpts {
8
8
  readonly name: string;
9
9
  readonly shortName: string;
10
10
  readonly roster: Player[];
11
- readonly country: Country;
12
- readonly league: League;
13
- readonly coach: Coach;
11
+ readonly country?: Country;
12
+ readonly league?: League;
13
+ readonly coach?: Coach;
14
14
  }
15
15
  export declare class Team {
16
16
  readonly id: string;
17
17
  readonly roster: Player[];
18
18
  readonly name: string;
19
19
  readonly shortName: string;
20
- readonly coach: Coach;
21
- readonly league: League;
22
- readonly country: Country;
20
+ readonly coach?: Coach;
21
+ readonly league?: League;
22
+ readonly country?: Country;
23
23
  private _rating;
24
24
  constructor({ id, rating, name, shortName, country, roster, coach, league }: TeamOpts);
25
25
  get rating(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.124",
3
+ "version": "0.0.125",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",