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

Commit e76fe70

Browse files
authored
v1.2.0
A release updating current modules, merging the `types` and `util` modules and more.
1 parent 81a1a03 commit e76fe70

19 files changed

Lines changed: 92 additions & 60 deletions

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.7",
3+
"version": "1.2.0",
44
"description": "Easy Script is a npm package which makes coding in JavaScript easy!",
55
"main": "src/index.js",
66
"scripts": {},

src/modules.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ module.exports = {
44
log: require("./modules/log"),
55
print: require("./modules/print"),
66
random: require("./modules/random"),
7-
types: {
8-
boolToNum: require("./modules/types/boolToNum"),
9-
boolToStr: require("./modules/types/boolToStr"),
10-
numToStr: require("./modules/types/numToStr"),
11-
strToBool: require("./modules/types/strToBool"),
12-
strToNum: require("./modules/types/strToNum"),
13-
},
147
util: {
15-
removeDuplicates: require("./modules/util/removeDuplicates"),
8+
boolToNum: require("./modules/util/boolToNum"),
9+
boolToStr: require("./modules/util/boolToStr"),
10+
numToStr: require("./modules/util/numToStr"),
11+
strToBool: require("./modules/util/strToBool"),
12+
strToNum: require("./modules/util/strToNum"),
13+
removeDuplicates: require("./modules/util/removeDuplicates")
1614
},
17-
uuid: require("./modules/uuid"),
15+
uuid: require("./modules/uuid")
1816
};

src/modules/flip.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**
22
* @function `flip` - Quickly execute a heads or tails decision randomly
3-
* @returns { String } - Returns "heads" or "tails" (*as a string*)
3+
* @returns { Number } - Returns 1 for heads or 0 for tails
44
*/
55

66
function flip() {
7-
return Math.random() >= 0.5 ? "heads" : "tails";
7+
return Math.random() >= 0.5 ? 1 : 0;
88
}
99

1010
module.exports = flip;

src/modules/id.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
const { customAlphabet } = require("nanoid");
22

33
/**
4-
* @function `id` - Randomly generate a unique ID composed of random characters and numbers
5-
* @param { Number } length - *Required* The length of the ID. Condition: *`1 <= length <= 64`*
6-
* @returns { String } - A unique ID string of a specified length (e.g. *abthvmyt3h1j3it*)
4+
* @function `id` - Generate a unique ID composed of random characters and numbers.
5+
* @param { Number } length - *Required* The length of the ID.
6+
* @returns { String } - A unique ID string of a specified length (e.g. abthvmyt3h1j3it)
77
*/
88

99
function id(length) {
1010
if (!length) throw new Error("No length specified");
1111
if (typeof length !== "number") throw new Error("Invalid type specified");
1212

13-
if (length > 64) throw new Error("Length cannot be more than 64");
14-
1513
const nanoid = customAlphabet(
1614
"1234567890abcdefghijklmnopqrstuvwxyz",
1715
length

src/modules/log.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @function `log` - Quickly log any data to the console.
3-
* @param { any } input - *Required* The data that will be passed on to the console. Will throw an error if the input is undefined
4-
* @returns { Function } - An instance of console.log() that is executed instantly using `input`
3+
* @param { any } input - *Required* The data that will be passed on to the console.
4+
* @returns { Function } - An instance of console.log() that is executed using `input`
55
*/
66

77
function log(input) {

src/modules/print.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @function `print` - Quickly log any data to the console.
3-
* @param { any } input - *Required* The data that will be passed on to the console. Will throw an error if the input is undefined
4-
* @returns { Function } - An instance of console.log() that is executed instantly using `input`
3+
* @param { any } input - *Required* The data that will be passed on to the console.
4+
* @returns { Function } - An instance of console.log() that is executed using `input`
55
*/
66

77
function print(input) {

src/modules/random.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* @function `random` - Used to generate a random number between 1 and a max value
2+
* @function `random` - Used to generate a random number between 1 and a max value.
33
* @param { Number } [max] - The max value used. Condition: **`1 < max < 2_147_483_647`**
4-
* @returns { Number } - A random number between 1 and max (*parameter*). If max is *undefined*, will return a random number between 1 and 100
4+
* @returns { Number } - A random number between 1 and max (*parameter*). If max is *undefined*, will return a random number between 1 and 100.
55
*/
66

77
function random(max) {

src/modules/types/boolToStr.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/modules/types/numToStr.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)