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

Commit 142c9b2

Browse files
authored
v1.1.0
This release adds lots of useful modules and cleans up the code a little bit.
1 parent d1ddd8b commit 142c9b2

11 files changed

Lines changed: 70 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="https://easyscript.js.org/images/cover.png">
2+
<img src="https://images.easyscript.dev/cover.png">
33
</p>
44

55
<h1 align="center">Easy Script</h1>

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "easyscriptjs",
3-
"version": "1.0.5",
3+
"version": "1.1.0",
44
"description": "Easy Script is a npm package which makes coding in JavaScript easy!",
55
"main": "src/index.js",
66
"scripts": {},
@@ -15,10 +15,10 @@
1515
"js",
1616
"script"
1717
],
18-
"author": "William Harrison",
18+
"author": "Easy Script <packages@easyscript.dev>",
1919
"license": "MIT",
2020
"bugs": {
2121
"url": "https://github.com/EasyScriptJS/EasyScript/issues"
2222
},
23-
"homepage": "https://github.com/EasyScriptJS/EasyScript#readme"
23+
"homepage": "https://easyscript.dev"
2424
}

src/modules.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ module.exports = {
22
"flip": require("./modules/flip"),
33
"log": require("./modules/log"),
44
"print": require("./modules/print"),
5-
"random": require("./modules/random")
5+
"random": require("./modules/random"),
6+
"util": require("./modules/util"),
7+
"uuid": require("./modules/uuid")
68
}

src/modules/util.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
"boolToNum": require("./util/boolToNum"),
3+
"boolToStr": require("./util/boolToStr"),
4+
"numToStr": require("./util/numToStr"),
5+
"strToBool": require("./util/strToBool"),
6+
"strToNum": require("./util/strToNum")
7+
}

src/modules/util/boolToNum.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = function boolToNum(boolean) {
2+
if(typeof boolean !== "boolean") throw new Error("No boolean provided");
3+
4+
let res;
5+
6+
if(boolean) res = + true;
7+
if(!boolean) res = + false;
8+
9+
return res;
10+
}

src/modules/util/boolToStr.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = function boolToStr(boolean) {
2+
if(typeof boolean !== "boolean") throw new Error("No boolean provided");
3+
4+
return boolean.toString();
5+
}

src/modules/util/numToStr.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = function numToStr(number) {
2+
if(!number || (typeof number !== "number")) throw new Error("No number provided");
3+
4+
return number.toString();
5+
}

src/modules/util/strToBool.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = function strToBool(string) {
2+
if(!string || (typeof string !== "string")) throw new Error("No string provided");
3+
4+
if(string !== "true" && string !== "false") throw new Error("No valid string provided");
5+
6+
let res;
7+
8+
if(string === "true") res = Boolean(true);
9+
if(string === "false") res = Boolean(false);
10+
11+
return res;
12+
}

src/modules/util/strToNum.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = function strToNum(string) {
2+
if(!string || (typeof string !== "string")) throw new Error("No string provided");
3+
4+
if(!isFinite(string)) throw new Error("No valid string provided");
5+
6+
return Number(string);
7+
}

0 commit comments

Comments
 (0)