UNPKG
dyson
Version:
alpha (2.0.0-alpha.1)
beta (2.0.0-beta.0)
latest (4.1.0)
4.1.0
4.0.0
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
2.0.0-beta.0
2.0.0-alpha.1
2.0.0-alpha.0
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.2
1.0.1
1.0.0
0.11.0
0.10.0
0.9.0
0.8.2
0.8.1
0.8.0
0.7.1
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.0
0.4.3
0.4.2
0.4.1
0.4.0
0.3.7
0.3.6
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.2
0.2.1
0.2.0
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.4
0.0.3
0.0.2
0.0.1
Node server for dynamic, fake JSON.
github.com/webpro/dyson
webpro/dyson
dyson
/
lib
/
delay.js
12 lines
(10 loc)
•
250 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
const
_ =
require
(
'lodash'
);
module
.
exports
=
delay
=>
(
req, res, next
) =>
{
if
(
typeof
delay ===
'number'
) { _.
delay
(next, delay); }
else
if
(_.
isArray
(delay)) { _.
delay
(next, _.
random
.
apply
(
null
, delay)); }
else
{
next
(); } };