js-jslog / harpstrata

A library for generating matrix representations of various harmonica layouts played in various positions
0 stars 0 forks source link

Remove or improve basic enum typeguards #29

Open js-jslog opened 4 years ago

js-jslog commented 4 years ago

DegreeIds and PozitionIds have overlapping names so these typeguards will be unreliable.

The typeguards for these enums is basically just a test of whether a string is part of the Object.values of the enum.

We can make the enum strings more specific (SECOND_POZITION rather than SECOND) which would prevent the overlap, or we could pass around typed objects with enum values rather than the enum ids themselves.