volleyballsimtypes 0.0.109 → 0.0.111

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: rallies,
38
- stats: model.MatchSetStats != null ? model.MatchSetStats.map(_1.transformToMatchSetStats) : []
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: model.MatchSetStats != null ? model.MatchSetStats.map(stats => (0, _1.transformToAPIMatchSetStats)(stats, model.order)) : []
61
+ stats
59
62
  };
60
63
  }
61
64
  exports.transformToAPIMatchSet = 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: CompetitionModel): APIMatch;
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;
@@ -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: rallies,
34
- stats: model.MatchSetStats != null ? model.MatchSetStats.map(transformToMatchSetStats) : []
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: model.MatchSetStats != null ? model.MatchSetStats.map(stats => transformToAPIMatchSetStats(stats, model.order)) : []
56
+ stats
54
57
  };
55
58
  }
56
59
  export { transformToObject as transformToMatchSet, transformToAPIObject as transformToAPIMatchSet, transformToAttributes as transformFromMatchSet };
@@ -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: CompetitionModel): APIMatch;
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.109",
3
+ "version": "0.0.111",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",