manuelbieh / geolib

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

isValidCoordinate throws with null and undefined #307

Open BrunoSoaresEngineering opened 3 months ago

BrunoSoaresEngineering commented 3 months ago

When using geolib.isValidCoordinate to validate input of a function that use geolib calculations, I would expect this method to return false for invalid input coordinates, including nulland undefined. It happens that, for these arguments, the method throws the following error: Uncaught Error: 'undefined' is no valid coordinate.