Skip to content

Are arrays of possible grades supposed to be part of the API? #160

Description

@musoke

src/index.ts exports some constants whose purpose is unclear to me:

sandbag/src/index.ts

Lines 266 to 288 in d5c4170

export const protection = ['G', 'PG', 'PG13', 'R', 'X']
// Bouldering
// Hueco
// Fontainebleau
// Brazilian
export const freeClimbing = {
clean: {
yds: YDS_ARRAY,
class: CLASS_ARRAY,
britishTech: BRITISH_TECH_ARRAY,
britishAdj: BRITISH_ADJ_ARRAY,
French: FRENCH_ARRAY,
UIAA: UIAA_ARRAY,
Ewbank: EWBANK_ARRAY,
Saxon: SAXON_ARRAY,
Norwegian: NORWAY_ARRAY
},
community: {}
}
export const bouldering = {}

It may be useful to expose these in the API, but the intention is unclear and the current definitions are wrong and/or missing.

Are these used anywhere? Or just leftover from earlier versions?

If these exports are intentional, they need to be fixed:

  • bouldering is empty
  • the analogous ice, aid, etc aren't defined
  • class is defined in freeClimbing but not as a GradeScale
  • YDS_ARRAY does not contain +/- grades
  • make it clear what is being exported: is it an ordered list of all possible non-slash grades for each scale for each discipline?
  • The current tests are nearly tautological.

If these exports are removed, the arrays comprising them can be too. Even better, they could be used to make slash grades more robust, as in #158.

  • delete exports
  • move arrays to respective files in src/scales/ and fix slash grades

@vnugent, do you have some insight on the intentions here?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions