@rasifix/orienteering-utils 2.0.65 → 2.0.66

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.
@@ -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.66",
4
4
  "description": "utility functions for orienteering result analyzis",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",