volleyballsimtypes 0.0.109 → 0.0.110
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.
|
@@ -3,5 +3,5 @@ import { Match } from '../../service';
|
|
|
3
3
|
import { APIMatch } from '../../api';
|
|
4
4
|
declare function transformToAttributes(match: Match): MatchAttributes;
|
|
5
5
|
declare function transformToObject(model: MatchModel): Match;
|
|
6
|
-
declare function transformToAPIObject(match: MatchModel, competition
|
|
6
|
+
declare function transformToAPIObject(match: MatchModel, competition?: CompetitionModel): APIMatch;
|
|
7
7
|
export { transformToObject as transformToMatch, transformToAPIObject as transformToAPIMatch, transformToAttributes as transformFromMatch };
|
|
@@ -37,8 +37,8 @@ function transformToAPIObject(match, competition) {
|
|
|
37
37
|
awayTeam: (0, _1.transformToAPITeam)(match.AwayTeam),
|
|
38
38
|
scheduledDate: new Date(match.scheduled_date),
|
|
39
39
|
sets,
|
|
40
|
-
season: competition.type === 'LEAGUE' ? (0, _1.transformToAPISeason)(competition) : undefined,
|
|
41
|
-
tournament: competition.type === 'TOURNAMENT' ? (0, _1.transformToAPITournament)(competition) : undefined
|
|
40
|
+
season: competition != null && competition.type === 'LEAGUE' ? (0, _1.transformToAPISeason)(competition) : undefined,
|
|
41
|
+
tournament: competition != null && competition.type === 'TOURNAMENT' ? (0, _1.transformToAPITournament)(competition) : undefined
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
exports.transformToAPIMatch = transformToAPIObject;
|
|
@@ -3,5 +3,5 @@ import { Match } from '../../service';
|
|
|
3
3
|
import { APIMatch } from '../../api';
|
|
4
4
|
declare function transformToAttributes(match: Match): MatchAttributes;
|
|
5
5
|
declare function transformToObject(model: MatchModel): Match;
|
|
6
|
-
declare function transformToAPIObject(match: MatchModel, competition
|
|
6
|
+
declare function transformToAPIObject(match: MatchModel, competition?: CompetitionModel): APIMatch;
|
|
7
7
|
export { transformToObject as transformToMatch, transformToAPIObject as transformToAPIMatch, transformToAttributes as transformFromMatch };
|
|
@@ -32,8 +32,8 @@ function transformToAPIObject(match, competition) {
|
|
|
32
32
|
awayTeam: transformToAPITeam(match.AwayTeam),
|
|
33
33
|
scheduledDate: new Date(match.scheduled_date),
|
|
34
34
|
sets,
|
|
35
|
-
season: competition.type === 'LEAGUE' ? transformToAPISeason(competition) : undefined,
|
|
36
|
-
tournament: competition.type === 'TOURNAMENT' ? transformToAPITournament(competition) : undefined
|
|
35
|
+
season: competition != null && competition.type === 'LEAGUE' ? transformToAPISeason(competition) : undefined,
|
|
36
|
+
tournament: competition != null && competition.type === 'TOURNAMENT' ? transformToAPITournament(competition) : undefined
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
export { transformToObject as transformToMatch, transformToAPIObject as transformToAPIMatch, transformToAttributes as transformFromMatch };
|