From de9aaf9b89d3602e85b2bee90ee1086a6e44e369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20C=C3=B4t=C3=A9=20Drolet?= Date: Fri, 3 Jan 2025 16:19:58 -0500 Subject: [PATCH] fix: isLatitude and isLongitude input value type --- src/decorator/common/IsLatitude.ts | 2 +- src/decorator/common/IsLongitude.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/decorator/common/IsLatitude.ts b/src/decorator/common/IsLatitude.ts index 1be12e130e..df487afd6f 100644 --- a/src/decorator/common/IsLatitude.ts +++ b/src/decorator/common/IsLatitude.ts @@ -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`); } diff --git a/src/decorator/common/IsLongitude.ts b/src/decorator/common/IsLongitude.ts index 013f5387af..ae18f67e04 100644 --- a/src/decorator/common/IsLongitude.ts +++ b/src/decorator/common/IsLongitude.ts @@ -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}`); }