volleyballsimtypes 0.0.110 → 0.0.112
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.
|
@@ -24,6 +24,7 @@ function transformToObject(model) {
|
|
|
24
24
|
.map(_1.transformToPlayerPosition) : [];
|
|
25
25
|
const awayPlayerPosition = model.SetPositions != null ? model.SetPositions.filter(p => p.side === 'Away')
|
|
26
26
|
.map(_1.transformToPlayerPosition) : [];
|
|
27
|
+
const stats = model.MatchSetStats != null ? model.MatchSetStats.map(_1.transformToMatchSetStats) : [];
|
|
27
28
|
const rallies = model.Rallies != null ? model.Rallies.map(_1.transformToRally) : [];
|
|
28
29
|
rallies.sort((r1, r2) => r1.order - r2.order);
|
|
29
30
|
return new service_1.MatchSet({
|
|
@@ -34,18 +35,20 @@ function transformToObject(model) {
|
|
|
34
35
|
isTieBreak: model.is_tie_break,
|
|
35
36
|
homePlayerPosition,
|
|
36
37
|
awayPlayerPosition,
|
|
37
|
-
rallies
|
|
38
|
-
stats
|
|
38
|
+
rallies,
|
|
39
|
+
stats
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
exports.transformToMatchSet = transformToObject;
|
|
42
43
|
function transformToAPIObject(model) {
|
|
43
44
|
const rallies = model.Rallies != null ? model.Rallies.map(_1.transformToAPIRally) : [];
|
|
44
45
|
rallies.sort((r1, r2) => r1.order - r2.order);
|
|
45
|
-
const homePlayerPosition = model.SetPositions.filter(p => p.side === 'Home')
|
|
46
|
-
.map(_1.transformToPlayerPosition);
|
|
47
|
-
const awayPlayerPosition = model.SetPositions.filter(p => p.side === 'Away')
|
|
48
|
-
.map(_1.transformToPlayerPosition);
|
|
46
|
+
const homePlayerPosition = model.SetPositions != null ? model.SetPositions.filter(p => p.side === 'Home')
|
|
47
|
+
.map(_1.transformToPlayerPosition) : [];
|
|
48
|
+
const awayPlayerPosition = model.SetPositions != null ? model.SetPositions.filter(p => p.side === 'Away')
|
|
49
|
+
.map(_1.transformToPlayerPosition) : [];
|
|
50
|
+
const stats = model.MatchSetStats != null ?
|
|
51
|
+
model.MatchSetStats.map(stats => (0, _1.transformToAPIMatchSetStats)(stats, model.order)) : [];
|
|
49
52
|
return {
|
|
50
53
|
id: model.match_id,
|
|
51
54
|
order: model.order,
|
|
@@ -55,7 +58,7 @@ function transformToAPIObject(model) {
|
|
|
55
58
|
rallies: rallies,
|
|
56
59
|
homePlayerPosition,
|
|
57
60
|
awayPlayerPosition,
|
|
58
|
-
stats
|
|
61
|
+
stats
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
exports.transformToAPIMatchSet = transformToAPIObject;
|
|
@@ -46,7 +46,7 @@ function transformToAPIObject(model) {
|
|
|
46
46
|
matches: matches,
|
|
47
47
|
iteration: model.iteration,
|
|
48
48
|
teams: model.Teams != null ? model.Teams.map(_1.transformToAPITeam) : [],
|
|
49
|
-
league: (0, _1.
|
|
49
|
+
league: (0, _1.transformToAPILeague)(model.LeagueSeason.league),
|
|
50
50
|
standings: season.standings,
|
|
51
51
|
champion: model.CompetitionChampion != null ? (0, _1.transformToAPITeam)(model.CompetitionChampion.team) : undefined
|
|
52
52
|
};
|
|
@@ -20,6 +20,7 @@ function transformToObject(model) {
|
|
|
20
20
|
.map(transformToPlayerPosition) : [];
|
|
21
21
|
const awayPlayerPosition = model.SetPositions != null ? model.SetPositions.filter(p => p.side === 'Away')
|
|
22
22
|
.map(transformToPlayerPosition) : [];
|
|
23
|
+
const stats = model.MatchSetStats != null ? model.MatchSetStats.map(transformToMatchSetStats) : [];
|
|
23
24
|
const rallies = model.Rallies != null ? model.Rallies.map(transformToRally) : [];
|
|
24
25
|
rallies.sort((r1, r2) => r1.order - r2.order);
|
|
25
26
|
return new MatchSet({
|
|
@@ -30,17 +31,19 @@ function transformToObject(model) {
|
|
|
30
31
|
isTieBreak: model.is_tie_break,
|
|
31
32
|
homePlayerPosition,
|
|
32
33
|
awayPlayerPosition,
|
|
33
|
-
rallies
|
|
34
|
-
stats
|
|
34
|
+
rallies,
|
|
35
|
+
stats
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
38
|
function transformToAPIObject(model) {
|
|
38
39
|
const rallies = model.Rallies != null ? model.Rallies.map(transformToAPIRally) : [];
|
|
39
40
|
rallies.sort((r1, r2) => r1.order - r2.order);
|
|
40
|
-
const homePlayerPosition = model.SetPositions.filter(p => p.side === 'Home')
|
|
41
|
-
.map(transformToPlayerPosition);
|
|
42
|
-
const awayPlayerPosition = model.SetPositions.filter(p => p.side === 'Away')
|
|
43
|
-
.map(transformToPlayerPosition);
|
|
41
|
+
const homePlayerPosition = model.SetPositions != null ? model.SetPositions.filter(p => p.side === 'Home')
|
|
42
|
+
.map(transformToPlayerPosition) : [];
|
|
43
|
+
const awayPlayerPosition = model.SetPositions != null ? model.SetPositions.filter(p => p.side === 'Away')
|
|
44
|
+
.map(transformToPlayerPosition) : [];
|
|
45
|
+
const stats = model.MatchSetStats != null ?
|
|
46
|
+
model.MatchSetStats.map(stats => transformToAPIMatchSetStats(stats, model.order)) : [];
|
|
44
47
|
return {
|
|
45
48
|
id: model.match_id,
|
|
46
49
|
order: model.order,
|
|
@@ -50,7 +53,7 @@ function transformToAPIObject(model) {
|
|
|
50
53
|
rallies: rallies,
|
|
51
54
|
homePlayerPosition,
|
|
52
55
|
awayPlayerPosition,
|
|
53
|
-
stats
|
|
56
|
+
stats
|
|
54
57
|
};
|
|
55
58
|
}
|
|
56
59
|
export { transformToObject as transformToMatchSet, transformToAPIObject as transformToAPIMatchSet, transformToAttributes as transformFromMatchSet };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformFromSeasonMatch, transformToAPIMatch, transformToAPITeam, transformToIteration,
|
|
1
|
+
import { transformFromSeasonMatch, transformToAPILeague, transformToAPIMatch, transformToAPITeam, transformToIteration, transformToMatch, transformToTeam } from '.';
|
|
2
2
|
import { Season } from '../../service';
|
|
3
3
|
function transformToAttributes(season, leagueId) {
|
|
4
4
|
const matches = season.matches != null ?
|
|
@@ -41,7 +41,7 @@ function transformToAPIObject(model) {
|
|
|
41
41
|
matches: matches,
|
|
42
42
|
iteration: model.iteration,
|
|
43
43
|
teams: model.Teams != null ? model.Teams.map(transformToAPITeam) : [],
|
|
44
|
-
league:
|
|
44
|
+
league: transformToAPILeague(model.LeagueSeason.league),
|
|
45
45
|
standings: season.standings,
|
|
46
46
|
champion: model.CompetitionChampion != null ? transformToAPITeam(model.CompetitionChampion.team) : undefined
|
|
47
47
|
};
|