@rasifix/orienteering-utils 2.0.11 → 2.0.12
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.js +6 -2
- package/package.json +1 -1
package/lib/utils/ranking.js
CHANGED
|
@@ -220,7 +220,11 @@ function defineCourses(runners) {
|
|
|
220
220
|
}
|
|
221
221
|
function defineRunners(runners) {
|
|
222
222
|
return runners.filter(function (runner) { return runner.splits.length > 0 && runner.splits.every(function (split) { return split.code; }); }).map(function (runner) {
|
|
223
|
-
var
|
|
223
|
+
var splits = runner.splits.map(function (split, idx) { return defineRunnerLegSplit(split, idx, runner); });
|
|
224
|
+
if (!runner.splits.some(function (s) { return s.code.endsWith("-Zi"); })) {
|
|
225
|
+
var lastSplit = defineRunnerLegSplit({ code: "Zi", time: runner.time }, runner.splits.length, runner);
|
|
226
|
+
splits = splits.concat([lastSplit]);
|
|
227
|
+
}
|
|
224
228
|
return {
|
|
225
229
|
id: runner.id,
|
|
226
230
|
rank: undefined,
|
|
@@ -229,7 +233,7 @@ function defineRunners(runners) {
|
|
|
229
233
|
yearOfBirth: runner.yearOfBirth,
|
|
230
234
|
city: runner.city,
|
|
231
235
|
club: runner.club,
|
|
232
|
-
splits:
|
|
236
|
+
splits: splits,
|
|
233
237
|
};
|
|
234
238
|
});
|
|
235
239
|
}
|