Skip to content

Commit b3331ce

Browse files
authored
Wcif 1.1 updates (#47)
* Releasing v1.1.2 * 1.1.5 * Updated types and helpers for wcif 1.1 * fixed formatting * Removed mean of 5 * Fixed formatting * Fixed format functions of '5'
1 parent fee4a4f commit b3331ce

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@wca/helpers",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "Helpers and class definitions for WCA and WCIF",
55
"keywords": [
66
"wca",

src/helpers/format.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export function getFormatName(format: RoundFormat): string {
88
return 'Best of 2';
99
case '3':
1010
return 'Best of 3';
11+
case '5':
12+
return 'Best of 5';
1113
case 'a':
1214
return 'Average of 5';
1315
case 'm':
@@ -20,6 +22,7 @@ export function getFormatRanking(format: RoundFormat): RankingType[] {
2022
case '1':
2123
case '2':
2224
case '3':
25+
case '5':
2326
return ['single'];
2427
case 'a':
2528
case 'm':
@@ -35,6 +38,8 @@ export function getFormatExpectedSolves(format: RoundFormat): number {
3538
return 2;
3639
case '3':
3740
return 3;
41+
case '5':
42+
return 5;
3843
case 'a':
3944
return 5;
4045
case 'm':
@@ -50,6 +55,7 @@ export function getFormatTrimBest(format: RoundFormat): number {
5055
case 'm':
5156
return 0;
5257
case 'a':
58+
case '5':
5359
return 1;
5460
}
5561
}
@@ -62,6 +68,7 @@ export function getFormatTrimWorst(format: RoundFormat): number {
6268
case 'm':
6369
return 0;
6470
case 'a':
71+
case '5':
6572
return 1;
6673
}
6774
}

src/models/roundFormat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export type RoundFormat = '1' | '2' | '3' | 'a' | 'm';
1+
export type RoundFormat = '1' | '2' | '3' | '5' | 'a' | 'm';

0 commit comments

Comments
 (0)