Skip to content

Commit

Permalink
feat: move lat/lon check to shared-client (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajabeckett authored Nov 17, 2023
1 parent 31cc04a commit bbacd58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ export const exists = <T>(haystack: T[], needle: T) =>

export const mapValues = <T, U>(obj: Record<any, T>, 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;

0 comments on commit bbacd58

Please sign in to comment.