Skip to content

Commit

Permalink
fix: isLatitude and isLongitude input value type
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliencd committed Jan 3, 2025
1 parent b07bb16 commit de9aaf9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/decorator/common/IsLatitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const IS_LATITUDE = 'isLatitude';
/**
* Checks if a given value is a latitude.
*/
export function isLatitude(value: string): boolean {
export function isLatitude(value: number | string): boolean {
return (typeof value === 'number' || typeof value === 'string') && isLatLong(`${value},0`);
}

Expand Down
2 changes: 1 addition & 1 deletion src/decorator/common/IsLongitude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const IS_LONGITUDE = 'isLongitude';
/**
* Checks if a given value is a longitude.
*/
export function isLongitude(value: string): boolean {
export function isLongitude(value: number | string): boolean {
return (typeof value === 'number' || typeof value === 'string') && isLatLong(`0,${value}`);
}

Expand Down

0 comments on commit de9aaf9

Please sign in to comment.