OpenBeta / sandbag

JS utilities for working with climbing grades
MIT License
24 stars 17 forks source link

Add Polish scale #173

Open Agilulfo opened 2 months ago

Agilulfo commented 2 months ago

Initial draft changes to add the polish scale a.k.a. kurtyka scale implements: #172

TODO:

github-actions[bot] commented 2 months ago

Coverage report

[!CAUTION] Coverage does not meet threshold Statements coverage not met for global: expected <=999999 not covered statements, but got 39

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements
95.12% (+7.62% πŸ”Ό)
39/41
🟒 Branches
83.33% (+15.79% πŸ”Ό)
5/6
🟒 Functions
90.91% (+11.04% πŸ”Ό)
10/11
🟒 Lines
94.59% (+7.91% πŸ”Ό)
35/37

Test suite run failed

Failed tests: 0/10. Failed suites: 16/18.
``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- ``` ● Test suite failed to run src/scales/polish.ts:13:3 - error TS2322: Type '{ displayName: string; name: "polish"; offset: number; allowableConversionType: ("yds" | "ewbank" | "saxon")[]; isType: (grade: string) => boolean; getScore: (grade: string) => number | Tuple; getGrade: (score: number | Tuple) => string; getGradeBand: (grade: string) => GradeBandTypes; }' is not assignable to type 'GradeScale'. Object literal may only specify known properties, and 'allowableConversionType' does not exist in type 'GradeScale'. 13 allowableConversionType: [GradeScales.YDS, GradeScales.EWBANK, GradeScales.SAXON], ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```

Report generated by πŸ§ͺjest coverage report action from becb95876fc6f413ab43441f34e0725d65f604cb

musoke commented 2 months ago

This looks like you're on the right path! Let us know if you need help.

Agilulfo commented 2 months ago

@musoke thank you! It might take me a while since I'm picking typescript as I go on my spare time. Will let you know when it is ready for review