You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/asynchrones.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ module.exports = {
14
14
if(time&&time>=0){
15
15
16
16
vartime=Number(time)
17
-
if((!time||time<0)&&time!=0)thrownewError("[wait-js] The time must be an integer, and more than 0!")
17
+
if((!time||time<0)&&time!=0)thrownewError("[wait-js] The time must be an integer, and more than 0!")
18
18
19
19
returnnewPromise((resolve,reject)=>{
20
20
setTimeout(()=>{
@@ -26,8 +26,8 @@ module.exports = {
26
26
}elseif(argument&&argument.timestamp){
27
27
28
28
vartimestampEnd=Number(argument.timestamp)
29
-
if(timestampEnd<Date.now())thrownewError("[wait-js] You can't delay something to the past!")
30
-
if((!timestampEnd||timestampEnd<0)&×tampEnd!=0)thrownewError("[wait-js] The timestamp must be an integer, and more than 0!")
29
+
if(timestampEnd<Date.now())thrownewError("[wait-js] You can't delay something to the past!")
30
+
if((!timestampEnd||timestampEnd<0)&×tampEnd!=0)thrownewError("[wait-js] The timestamp must be an integer, and more than 0!")
31
31
32
32
returnnewPromise((resolve,reject)=>{
33
33
setTimeout(()=>{
@@ -36,7 +36,7 @@ module.exports = {
36
36
})
37
37
38
38
39
-
}elsethrownewError("[wait-js] You called the wait() function without arguments, or your arguments are invalid!")
39
+
}elsethrownewError("[wait-js] You called the wait() function without arguments, or your arguments are invalid!")
40
40
},
41
41
42
42
/*
@@ -48,7 +48,7 @@ module.exports = {
48
48
asyncrandomwait(min,max){
49
49
50
50
returnnewPromise(async(resolve,reject)=>{
51
-
if(((!min&&min!=0)||min<0)||((!max&&max!=0||max<0)))thrownewError("[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)))thrownewError("[wait-js] You called the randomwait() function without arguments, or your arguments are invalid!")
Copy file name to clipboardExpand all lines: src/synchrones.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ module.exports = {
14
14
if(time&&time>=0){
15
15
16
16
vartime=Number(time)
17
-
if((!time||time<0)&&time!=0)thrownewError("[wait-js] The time must be an integer, and more than 0!")
17
+
if((!time||time<0)&&time!=0)thrownewError("[wait-js] The time must be an integer, and more than 0!")
18
18
19
19
vardebut=Date.now()
20
20
while(Date.now()-debut<time){
@@ -26,16 +26,16 @@ module.exports = {
26
26
}elseif(argument&&argument.timestamp){
27
27
28
28
vartimestampEnd=Number(argument.timestamp)
29
-
if(timestampEnd<Date.now())thrownewError("[wait-js] You can't delay something to the past!")
30
-
if((!timestampEnd||timestampEnd<0)&×tampEnd!=0)thrownewError("[wait-js] The timestamp must be an integer, and more than 0!")
29
+
if(timestampEnd<Date.now())thrownewError("[wait-js] You can't delay something to the past!")
30
+
if((!timestampEnd||timestampEnd<0)&×tampEnd!=0)thrownewError("[wait-js] The timestamp must be an integer, and more than 0!")
31
31
32
32
while(Date.now()<timestamp){
33
33
34
34
}
35
35
returntrue
36
36
37
37
38
-
}elsethrownewError("[wait-js] You called the wait() function without arguments, or your arguments are invalid!")
38
+
}elsethrownewError("[wait-js] You called the wait() function without arguments, or your arguments are invalid!")
39
39
},
40
40
41
41
/*
@@ -47,7 +47,7 @@ module.exports = {
47
47
srandomwait(min,max){
48
48
49
49
returnnewPromise(async(resolve,reject)=>{
50
-
if(((!min&&min!=0)||min<0)||((!max&&max!=0||max<0)))thrownewError("[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)))thrownewError("[wait-js] You called the randomwait() function without arguments, or your arguments are invalid!")
0 commit comments