@rasifix/orienteering-utils 2.0.67 → 2.0.68

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.
@@ -29,7 +29,7 @@ function assignLegInfoToSplits(runners, legs) {
29
29
  .forEach(function (split) {
30
30
  var leg = legs[split.legCode];
31
31
  if (!leg) {
32
- throw "leg with code " + split.leg + " not defined!";
32
+ throw "leg with code " + split.legCode + " not defined!";
33
33
  }
34
34
  split.legCode = leg.code;
35
35
  var legRunner = leg.runners.find(function (r) { return r.id === runner.id; });
@@ -367,7 +367,6 @@ function defineLegs(runners) {
367
367
  }, {});
368
368
  runners.forEach(function (runner) {
369
369
  runner.splits
370
- //.filter((s) => validTime(s.time))
371
370
  .forEach(function (split, idx) {
372
371
  var from = idx === 0 ? "St" : runner.splits[idx - 1].code;
373
372
  var to = split.code;
@@ -407,6 +406,7 @@ function defineLegProperties(legs) {
407
406
  });
408
407
  // calculate the ideal time: take up to 5 fastest on that leg
409
408
  var selected = leg.runners
409
+ .filter(function (runner) { return runner.split > 0; })
410
410
  .slice(0, Math.min(leg.runners.length, 5))
411
411
  .map(function (runner) { return runner.split; });
412
412
  // only if there are valid splits for this leg
@@ -56,6 +56,7 @@ function parseRelayRanking(runners) {
56
56
  id: firstRunner.id,
57
57
  category: firstRunner.category,
58
58
  fullName: teamRunners.map(function (r) { return r.fullName; }).join(' / '),
59
+ club: teamRunners.map(function (r) { return r.club; }).join(' / '),
59
60
  startTime: firstRunner.startTime,
60
61
  startNumber: startNumber,
61
62
  team: firstRunner.team,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasifix/orienteering-utils",
3
- "version": "2.0.67",
3
+ "version": "2.0.68",
4
4
  "description": "utility functions for orienteering result analyzis",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",