Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit 845dc8b

Browse files
authored
v1.1.1
Fixes a bug when using the `random` module without input.
1 parent 142c9b2 commit 845dc8b

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easyscriptjs",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Easy Script is a npm package which makes coding in JavaScript easy!",
55
"main": "src/index.js",
66
"scripts": {},

src/modules/random.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = function random(max) {
22
let highest = 100;
33

4-
if(isNaN(max)) throw new Error("Max number must be a number");
4+
if(max && !isFinite(max)) throw new Error("Max number must be a number");
55
if(max && max <= 1 || max && max >= 2147483647) throw new Error("Max number must be higher than 1 and lower than 2,147,483,647");
66

77
if(max) highest = max;

0 commit comments

Comments
 (0)