Skip to content

Commit

Permalink
feat: add type check to isValidDestinationTag method
Browse files Browse the repository at this point in the history
  • Loading branch information
N3TC4T committed Nov 1, 2024
1 parent d717f6a commit eeb4fa3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/common/utils/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eeb4fa3

Please sign in to comment.