@rasifix/orienteering-utils 2.0.66 → 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.
- package/lib/utils/ranking.d.ts +2 -0
- package/lib/utils/ranking.js +4 -2
- package/lib/utils/relay.js +1 -0
- package/package.json +1 -1
package/lib/utils/ranking.d.ts
CHANGED
package/lib/utils/ranking.js
CHANGED
|
@@ -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.
|
|
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; });
|
|
@@ -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,
|
|
@@ -365,7 +367,6 @@ function defineLegs(runners) {
|
|
|
365
367
|
}, {});
|
|
366
368
|
runners.forEach(function (runner) {
|
|
367
369
|
runner.splits
|
|
368
|
-
//.filter((s) => validTime(s.time))
|
|
369
370
|
.forEach(function (split, idx) {
|
|
370
371
|
var from = idx === 0 ? "St" : runner.splits[idx - 1].code;
|
|
371
372
|
var to = split.code;
|
|
@@ -405,6 +406,7 @@ function defineLegProperties(legs) {
|
|
|
405
406
|
});
|
|
406
407
|
// calculate the ideal time: take up to 5 fastest on that leg
|
|
407
408
|
var selected = leg.runners
|
|
409
|
+
.filter(function (runner) { return runner.split > 0; })
|
|
408
410
|
.slice(0, Math.min(leg.runners.length, 5))
|
|
409
411
|
.map(function (runner) { return runner.split; });
|
|
410
412
|
// only if there are valid splits for this leg
|
package/lib/utils/relay.js
CHANGED
|
@@ -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,
|