mirror of
https://github.com/veganhacktivists/arabot.git
synced 2025-05-19 10:34:16 +02:00
feat(utils): add isNumber
This commit is contained in:
parent
dda77483eb
commit
5503edd70b
@ -16,6 +16,16 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user