diff --git a/src/utils.ts b/src/utils.ts index 7504b5b1..5f6465de 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -9,3 +9,7 @@ export const exists = (haystack: T[], needle: T) => export const mapValues = (obj: Record, f: (arg: T) => U) => Object.values(obj).map(f); + +export const isValidLatitude = (lat: number) => lat >= -90 && lat <= 90; + +export const isValidLongitude = (lng: number) => lng >= -180 && lng <= 180;