Hey guys, thought I chip in and add some test coverage. Along way I encountered what seemed to be a bug and fixed that. Please let me know of any changes that should made.
Add test coverage to the following files:
findNearest.ts
getRoughCompassDirection.ts
isValidLatitude.ts
isValidLongitude.ts
toDeg.ts
toRad.ts
Made fixes to src/getRoughCompassDirection.ts:
What was happening here was the Regular expression would validate as true if string contained the value rather than matched exactly with value. For example, /^NNE|NE|NNW|N$/ would return N for ENE because ENE contains NE. The fix was to alter the regex so it performs a strict match rather than "contains".
Hey guys, thought I chip in and add some test coverage. Along way I encountered what seemed to be a bug and fixed that. Please let me know of any changes that should made.
Add test coverage to the following files:
Made fixes to src/getRoughCompassDirection.ts:
What was happening here was the Regular expression would validate as true if string contained the value rather than matched exactly with value. For example,
/^NNE|NE|NNW|N$/
would returnN
forENE
becauseENE
containsNE
. The fix was to alter the regex so it performs a strict match rather than "contains".