manuelbieh / geolib

Zero dependency library to provide some basic geo functions
MIT License
4.23k stars 342 forks source link

test/fix: Added test coverage and made fixed to getRoughCompassDirection #300

Closed ddarren closed 1 year ago

ddarren commented 1 year ago

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 return N for ENE because ENE contains NE. The fix was to alter the regex so it performs a strict match rather than "contains".

manuelbieh commented 1 year ago

:tada: This PR is included in version 3.3.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: