From bbacd58874cda0fa41ced54bbf63cf410f98773e Mon Sep 17 00:00:00 2001 From: ajabeckett <31599074+ajabeckett@users.noreply.github.com> Date: Fri, 17 Nov 2023 07:18:45 -0800 Subject: [PATCH] feat: move lat/lon check to shared-client (#165) --- src/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) 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;