@rasifix/orienteering-utils 2.0.65 → 2.0.67

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.
@@ -39,6 +39,8 @@ export interface RankingRunner {
39
39
  course?: string;
40
40
  rank?: number;
41
41
  fullName: string;
42
+ team?: string;
43
+ legOrRun?: number;
42
44
  time?: string;
43
45
  errorTime: string;
44
46
  yearOfBirth?: string;
@@ -287,6 +287,8 @@ function defineRunners(runners) {
287
287
  category: runner.category,
288
288
  rank: undefined,
289
289
  fullName: runner.fullName,
290
+ team: runner.team,
291
+ legOrRun: runner.runOrLeg,
290
292
  time: runner.time,
291
293
  yearOfBirth: runner.yearOfBirth,
292
294
  city: runner.city,
@@ -63,6 +63,7 @@ function parseRelayRanking(runners) {
63
63
  };
64
64
  // Combine splits from all legs
65
65
  var accumulatedTime = 0;
66
+ var previousValid = true;
66
67
  teamRunners.forEach(function (runner) {
67
68
  runner.splits.forEach(function (split) {
68
69
  var splitTime = (0, time_1.parseTime)(split.time);
@@ -83,9 +84,10 @@ function parseRelayRanking(runners) {
83
84
  accumulatedTime += runnerTotalTime;
84
85
  }
85
86
  }
87
+ previousValid = previousValid && (runner.time !== undefined) && (0, time_1.parseTime)(runner.time) !== undefined;
86
88
  });
87
89
  // Set the final combined time
88
- combinedRunner.time = (0, time_1.formatTime)(accumulatedTime);
90
+ combinedRunner.time = previousValid ? (0, time_1.formatTime)(accumulatedTime) : "DSQ";
89
91
  combinedRunners.push(combinedRunner);
90
92
  });
91
93
  // Parse the ranking as usual
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasifix/orienteering-utils",
3
- "version": "2.0.65",
3
+ "version": "2.0.67",
4
4
  "description": "utility functions for orienteering result analyzis",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",