volleyballsimtypes 0.0.33 → 0.0.35

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.
@@ -11,11 +11,11 @@ import type { SeasonTeamsId, SeasonTeamsModel } from './season-teams';
11
11
  import { LeagueAttributes, LeagueId, LeagueModel } from './league';
12
12
  export interface TeamAttributes {
13
13
  team_id: string;
14
- coach_id: string;
15
- league_id: string;
16
14
  name: string;
17
15
  short_name: string;
18
- country_id: string;
16
+ coach_id?: string;
17
+ league_id?: string;
18
+ country_id?: string;
19
19
  coach?: CoachAttributes;
20
20
  league?: LeagueAttributes;
21
21
  Players?: PlayerModel[];
@@ -11,8 +11,8 @@ function transformToAttributes(season, leagueId) {
11
11
  iteration: season.iteration,
12
12
  league_id: leagueId,
13
13
  champion: season.champion != null ? season.champion.id : undefined,
14
- seasonTeams: season.teams.map(team_1.transformFromTeam),
15
- seasonMatches: season.matches.map(match_1.transformFromMatch)
14
+ seasonTeams: season.teams != null ? season.teams.map(team_1.transformFromTeam) : [],
15
+ seasonMatches: season.matches != null ? season.matches.map(match_1.transformFromMatch) : []
16
16
  };
17
17
  }
18
18
  exports.transformFromSeason = transformToAttributes;
@@ -10,9 +10,9 @@ function transformToAttributes(team) {
10
10
  team_id: team.id,
11
11
  name: team.name,
12
12
  short_name: team.shortName,
13
- coach_id: team.coach.id,
14
- country_id: team.country.id,
15
- league_id: team.league.id,
13
+ coach_id: team.coach != null ? team.coach.id : undefined,
14
+ country_id: team.country != null ? team.country.id : undefined,
15
+ league_id: team.league != null ? team.league.id : undefined,
16
16
  coach: team.coach != null ? (0, coach_1.transformFromCoach)(team.coach) : undefined
17
17
  };
18
18
  }
@@ -11,11 +11,11 @@ import type { SeasonTeamsId, SeasonTeamsModel } from './season-teams';
11
11
  import { LeagueAttributes, LeagueId, LeagueModel } from './league';
12
12
  export interface TeamAttributes {
13
13
  team_id: string;
14
- coach_id: string;
15
- league_id: string;
16
14
  name: string;
17
15
  short_name: string;
18
- country_id: string;
16
+ coach_id?: string;
17
+ league_id?: string;
18
+ country_id?: string;
19
19
  coach?: CoachAttributes;
20
20
  league?: LeagueAttributes;
21
21
  Players?: PlayerModel[];
@@ -8,8 +8,8 @@ function transformToAttributes(season, leagueId) {
8
8
  iteration: season.iteration,
9
9
  league_id: leagueId,
10
10
  champion: season.champion != null ? season.champion.id : undefined,
11
- seasonTeams: season.teams.map(transformFromTeam),
12
- seasonMatches: season.matches.map(transformFromMatch)
11
+ seasonTeams: season.teams != null ? season.teams.map(transformFromTeam) : [],
12
+ seasonMatches: season.matches != null ? season.matches.map(transformFromMatch) : []
13
13
  };
14
14
  }
15
15
  function transformToObject(model) {
@@ -7,9 +7,9 @@ function transformToAttributes(team) {
7
7
  team_id: team.id,
8
8
  name: team.name,
9
9
  short_name: team.shortName,
10
- coach_id: team.coach.id,
11
- country_id: team.country.id,
12
- league_id: team.league.id,
10
+ coach_id: team.coach != null ? team.coach.id : undefined,
11
+ country_id: team.country != null ? team.country.id : undefined,
12
+ league_id: team.league != null ? team.league.id : undefined,
13
13
  coach: team.coach != null ? transformFromCoach(team.coach) : undefined
14
14
  };
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",