@rasifix/orienteering-utils 2.0.7 → 2.0.9
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 +4 -5
- package/lib/utils/ranking.js +2 -1
- package/package.json +1 -1
package/lib/utils/ranking.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface Ranking {
|
|
|
33
33
|
runners: RankingRunner[];
|
|
34
34
|
legs: RunnerLeg[];
|
|
35
35
|
}
|
|
36
|
-
interface RankingRunner {
|
|
36
|
+
export interface RankingRunner {
|
|
37
37
|
id: string;
|
|
38
38
|
rank?: number;
|
|
39
39
|
fullName: string;
|
|
@@ -43,7 +43,7 @@ interface RankingRunner {
|
|
|
43
43
|
club?: string;
|
|
44
44
|
splits: RankingSplit[];
|
|
45
45
|
}
|
|
46
|
-
interface RankingSplit {
|
|
46
|
+
export interface RankingSplit {
|
|
47
47
|
code: string;
|
|
48
48
|
legCode: string;
|
|
49
49
|
time?: number;
|
|
@@ -64,13 +64,12 @@ export interface RankingEntry {
|
|
|
64
64
|
time: string;
|
|
65
65
|
runnerRef: string;
|
|
66
66
|
}
|
|
67
|
-
interface RankingInfo {
|
|
67
|
+
export interface RankingInfo {
|
|
68
68
|
rank?: number;
|
|
69
69
|
behind?: number;
|
|
70
70
|
idealBehind?: number;
|
|
71
71
|
}
|
|
72
|
-
interface SplitInfo extends RankingInfo {
|
|
72
|
+
export interface SplitInfo extends RankingInfo {
|
|
73
73
|
performanceIndex?: number;
|
|
74
74
|
}
|
|
75
75
|
export declare function parseRanking(runners: Runner[]): Ranking;
|
|
76
|
-
export {};
|
package/lib/utils/ranking.js
CHANGED
|
@@ -348,7 +348,8 @@ function defineLegProperties(legs) {
|
|
|
348
348
|
if (selected.length > 0) {
|
|
349
349
|
leg.idealSplit = Math.round(selected.reduce(sum) / selected.length);
|
|
350
350
|
if (leg.idealSplit < 0) {
|
|
351
|
-
|
|
351
|
+
console.log("invalid ideal split calculated for leg " + code, leg.idealSplit);
|
|
352
|
+
leg.idealSplit = 30;
|
|
352
353
|
}
|
|
353
354
|
}
|
|
354
355
|
// only if there are valid splits for this leg
|