volleyballsimtypes 0.0.454 → 0.0.455

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,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformFromMatchRating = transformToAttributes;
4
4
  const service_1 = require("../../service");
5
5
  function transformToAttributes(team, rating) {
6
- const teamId = team === service_1.MatchTeam.HOME ? rating.match.homeTeam.id : rating.match.awayTeam.id;
7
6
  if (team == null)
8
- throw new Error(`INVALID_TEAM: ${teamId}`);
7
+ throw new Error('INVALID_TEAM');
8
+ const teamId = team === service_1.MatchTeam.HOME ? rating.match.homeTeam.id : rating.match.awayTeam.id;
9
9
  return {
10
10
  match_id: rating.match.id,
11
11
  team_id: teamId,
@@ -1,5 +1,4 @@
1
- import { Qualifier, Region } from '../../service';
2
- import { RegionQualifierAttributes, RegionQualifierModel } from '../models';
3
- declare function transformToAttributes(qualifier: Qualifier): RegionQualifierAttributes;
1
+ import { Region } from '../../service';
2
+ import { RegionQualifierModel } from '../models';
4
3
  declare function transformToRegion(model: RegionQualifierModel): Region;
5
- export { transformToAttributes as transformFromRegionQualifier, transformToRegion };
4
+ export { transformToRegion };
@@ -1,14 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformFromRegionQualifier = transformToAttributes;
4
3
  exports.transformToRegion = transformToRegion;
5
- function transformToAttributes(qualifier) {
6
- return {
7
- iteration: qualifier.iteration.id,
8
- region_code: qualifier.region.code,
9
- competition_id: qualifier.id
10
- };
11
- }
12
4
  function transformToRegion(model) {
13
5
  return {
14
6
  code: model.region_code,
@@ -1,8 +1,8 @@
1
1
  import { MatchTeam } from '../../service';
2
2
  function transformToAttributes(team, rating) {
3
- const teamId = team === MatchTeam.HOME ? rating.match.homeTeam.id : rating.match.awayTeam.id;
4
3
  if (team == null)
5
- throw new Error(`INVALID_TEAM: ${teamId}`);
4
+ throw new Error('INVALID_TEAM');
5
+ const teamId = team === MatchTeam.HOME ? rating.match.homeTeam.id : rating.match.awayTeam.id;
6
6
  return {
7
7
  match_id: rating.match.id,
8
8
  team_id: teamId,
@@ -1,5 +1,4 @@
1
- import { Qualifier, Region } from '../../service';
2
- import { RegionQualifierAttributes, RegionQualifierModel } from '../models';
3
- declare function transformToAttributes(qualifier: Qualifier): RegionQualifierAttributes;
1
+ import { Region } from '../../service';
2
+ import { RegionQualifierModel } from '../models';
4
3
  declare function transformToRegion(model: RegionQualifierModel): Region;
5
- export { transformToAttributes as transformFromRegionQualifier, transformToRegion };
4
+ export { transformToRegion };
@@ -1,14 +1,7 @@
1
- function transformToAttributes(qualifier) {
2
- return {
3
- iteration: qualifier.iteration.id,
4
- region_code: qualifier.region.code,
5
- competition_id: qualifier.id
6
- };
7
- }
8
1
  function transformToRegion(model) {
9
2
  return {
10
3
  code: model.region_code,
11
4
  name: model.countryRegion?.region ?? model.region_code
12
5
  };
13
6
  }
14
- export { transformToAttributes as transformFromRegionQualifier, transformToRegion };
7
+ export { transformToRegion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.454",
3
+ "version": "0.0.455",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",