From eeb4fa333fdd85efbf1f61308d83378995d4fa7c Mon Sep 17 00:00:00 2001 From: N3TC4T Date: Fri, 1 Nov 2024 16:06:16 +0100 Subject: [PATCH] feat: add type check to isValidDestinationTag method --- src/common/utils/string.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/utils/string.ts b/src/common/utils/string.ts index e19082723..ce301e897 100644 --- a/src/common/utils/string.ts +++ b/src/common/utils/string.ts @@ -133,6 +133,11 @@ const StringTypeCheck = { }, isValidDestinationTag: (input: string): boolean => { + // not a valid input + if (typeof input !== 'string') { + return false; + } + // not a valid number if (!input.match(/^[+-]?\d+(?:[.]*\d*(?:[eE][+-]?\d+)?)?$/)) { return false;