volleyballsimtypes 0.0.15 → 0.0.16
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.
|
@@ -16,9 +16,9 @@ function transformToAttributes(match, season) {
|
|
|
16
16
|
}
|
|
17
17
|
exports.transformFromMatch = transformToAttributes;
|
|
18
18
|
function transformToObject(model) {
|
|
19
|
-
const sets = model.MatchSets.length < 1
|
|
20
|
-
model.MatchSets.map(match_set_1.transformToMatchSet)
|
|
21
|
-
|
|
19
|
+
const sets = model.MatchSets == null || model.MatchSets.length < 1
|
|
20
|
+
? [] : model.MatchSets.map(match_set_1.transformToMatchSet)
|
|
21
|
+
.sort((s1, s2) => s1.order - s2.order);
|
|
22
22
|
return new service_1.Match({
|
|
23
23
|
id: model.match_id,
|
|
24
24
|
homeTeam: (0, team_1.transformToTeam)(model.homeTeam),
|
|
@@ -30,9 +30,9 @@ function transformToObject(model) {
|
|
|
30
30
|
}
|
|
31
31
|
exports.transformToMatch = transformToObject;
|
|
32
32
|
function transformToAPIObject(model) {
|
|
33
|
-
const sets = model.MatchSets.length < 1
|
|
34
|
-
model.MatchSets.map(match_set_1.transformToAPIMatchSet)
|
|
35
|
-
|
|
33
|
+
const sets = model.MatchSets == null || model.MatchSets.length < 1
|
|
34
|
+
? [] : model.MatchSets.map(match_set_1.transformToAPIMatchSet)
|
|
35
|
+
.sort((s1, s2) => s1.order - s2.order);
|
|
36
36
|
return {
|
|
37
37
|
id: model.match_id,
|
|
38
38
|
homeTeam: (0, team_1.transformToAPITeam)(model.homeTeam),
|
|
@@ -12,9 +12,9 @@ function transformToAttributes(match, season) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function transformToObject(model) {
|
|
15
|
-
const sets = model.MatchSets.length < 1
|
|
16
|
-
model.MatchSets.map(transformToMatchSet)
|
|
17
|
-
|
|
15
|
+
const sets = model.MatchSets == null || model.MatchSets.length < 1
|
|
16
|
+
? [] : model.MatchSets.map(transformToMatchSet)
|
|
17
|
+
.sort((s1, s2) => s1.order - s2.order);
|
|
18
18
|
return new Match({
|
|
19
19
|
id: model.match_id,
|
|
20
20
|
homeTeam: transformToTeam(model.homeTeam),
|
|
@@ -25,9 +25,9 @@ function transformToObject(model) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function transformToAPIObject(model) {
|
|
28
|
-
const sets = model.MatchSets.length < 1
|
|
29
|
-
model.MatchSets.map(transformToAPIMatchSet)
|
|
30
|
-
|
|
28
|
+
const sets = model.MatchSets == null || model.MatchSets.length < 1
|
|
29
|
+
? [] : model.MatchSets.map(transformToAPIMatchSet)
|
|
30
|
+
.sort((s1, s2) => s1.order - s2.order);
|
|
31
31
|
return {
|
|
32
32
|
id: model.match_id,
|
|
33
33
|
homeTeam: transformToAPITeam(model.homeTeam),
|