Skip to content

Commit 3c8f8b0

Browse files
authored
(fix: Improving English)
1 parent 9d6435b commit 3c8f8b0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/asynchrones.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
if (time && time >= 0) {
1515

1616
var time = Number(time)
17-
if ((!time || time < 0) && time != 0) throw new Error("[wait-js] The time must be an integer, and more than 0 !")
17+
if ((!time || time < 0) && time != 0) throw new Error("[wait-js] The time must be an integer, and more than 0!")
1818

1919
return new Promise((resolve, reject) => {
2020
setTimeout(() => {
@@ -26,8 +26,8 @@ module.exports = {
2626
} else if (argument && argument.timestamp) {
2727

2828
var timestampEnd = Number(argument.timestamp)
29-
if (timestampEnd < Date.now()) throw new Error("[wait-js] You can't delay something to the past !")
30-
if ((!timestampEnd || timestampEnd < 0) && timestampEnd != 0) throw new Error("[wait-js] The timestamp must be an integer, and more than 0 !")
29+
if (timestampEnd < Date.now()) throw new Error("[wait-js] You can't delay something to the past!")
30+
if ((!timestampEnd || timestampEnd < 0) && timestampEnd != 0) throw new Error("[wait-js] The timestamp must be an integer, and more than 0!")
3131

3232
return new Promise((resolve, reject) => {
3333
setTimeout(() => {
@@ -36,7 +36,7 @@ module.exports = {
3636
})
3737

3838

39-
} else throw new Error("[wait-js] You called the wait() function without arguments, or your arguments are invalid !")
39+
} else throw new Error("[wait-js] You called the wait() function without arguments, or your arguments are invalid!")
4040
},
4141

4242
/*
@@ -48,7 +48,7 @@ module.exports = {
4848
async randomwait(min, max) {
4949

5050
return new Promise(async (resolve, reject) => {
51-
if (((!min && min != 0) || min < 0) || ((!max && max != 0 || max < 0))) throw new Error("[wait-js] You called the randomwait() function without arguments, or your arguments are invalid !")
51+
if (((!min && min != 0) || min < 0) || ((!max && max != 0 || max < 0))) throw new Error("[wait-js] You called the randomwait() function without arguments, or your arguments are invalid!")
5252
const random = Math.floor(Math.random() * max) + min;
5353
setTimeout(() => {
5454
resolve(true)

src/synchrones.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
if (time && time >= 0) {
1515

1616
var time = Number(time)
17-
if ((!time || time < 0) && time != 0) throw new Error("[wait-js] The time must be an integer, and more than 0 !")
17+
if ((!time || time < 0) && time != 0) throw new Error("[wait-js] The time must be an integer, and more than 0!")
1818

1919
var debut = Date.now()
2020
while (Date.now() - debut < time) {
@@ -26,16 +26,16 @@ module.exports = {
2626
} else if (argument && argument.timestamp) {
2727

2828
var timestampEnd = Number(argument.timestamp)
29-
if (timestampEnd < Date.now()) throw new Error("[wait-js] You can't delay something to the past !")
30-
if ((!timestampEnd || timestampEnd < 0) && timestampEnd != 0) throw new Error("[wait-js] The timestamp must be an integer, and more than 0 !")
29+
if (timestampEnd < Date.now()) throw new Error("[wait-js] You can't delay something to the past!")
30+
if ((!timestampEnd || timestampEnd < 0) && timestampEnd != 0) throw new Error("[wait-js] The timestamp must be an integer, and more than 0!")
3131

3232
while (Date.now() < timestamp) {
3333

3434
}
3535
return true
3636

3737

38-
} else throw new Error("[wait-js] You called the wait() function without arguments, or your arguments are invalid !")
38+
} else throw new Error("[wait-js] You called the wait() function without arguments, or your arguments are invalid!")
3939
},
4040

4141
/*
@@ -47,7 +47,7 @@ module.exports = {
4747
srandomwait(min, max) {
4848

4949
return new Promise(async (resolve, reject) => {
50-
if (((!min && min != 0) || min < 0) || ((!max && max != 0 || max < 0))) throw new Error("[wait-js] You called the randomwait() function without arguments, or your arguments are invalid !")
50+
if (((!min && min != 0) || min < 0) || ((!max && max != 0 || max < 0))) throw new Error("[wait-js] You called the randomwait() function without arguments, or your arguments are invalid!")
5151
const random = Math.floor(Math.random() * max) + min;
5252
setTimeout(() => {
5353
resolve(true)

0 commit comments

Comments
 (0)