From 1e0d54f5d6ff6b7f19e0eb77f0a7baead7e62021 Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Thu, 16 Jan 2025 14:23:19 +0800 Subject: [PATCH] some basic helpers --- helpers/basic.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helpers/basic.sh b/helpers/basic.sh index d964f4b..4a68ce7 100644 --- a/helpers/basic.sh +++ b/helpers/basic.sh @@ -85,3 +85,11 @@ cdownload() { require curl curl -fsSL "$1" -o "$2" } + +is_int() { + [[ "$1" =~ ^[0-9]+$ ]] +} + +is_number() { + [[ "$1" =~ ^[0-9]+([.,][0-9]+)?$ ]] +}