diff --git a/src/utils/maths.ts b/src/utils/maths.ts index 458839c..cbb9859 100644 --- a/src/utils/maths.ts +++ b/src/utils/maths.ts @@ -16,6 +16,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + +/** + * Checks if any parsed value is a number. + * @param number check if variable is a number + * @returns {boolean} true if it is a number + */ +export function isNumber(number: any) { + return !Number.isNaN(+number); +} + /** * Creates a (PRNG) random integer between minimum and maximum both inclusive * @param min minimum integer