We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6ddade commit db6061aCopy full SHA for db6061a
1 file changed
index.js
@@ -9,6 +9,7 @@
9
10
/**
11
* Module dependencies.
12
+ * @private
13
*/
14
15
var createError = require('http-errors')
@@ -18,6 +19,7 @@ var onHeaders = require('on-headers')
18
19
20
21
* Module exports.
22
+ * @public
23
24
25
module.exports = timeout
@@ -30,7 +32,7 @@ module.exports = timeout
30
32
* @param {Number} time
31
33
* @param {Object} options
34
* @return {Function} middleware
- * @api public
35
36
37
38
function timeout (time, options) {
@@ -70,6 +72,14 @@ function timeout (time, options) {
70
72
}
71
73
74
75
+/**
76
+ * Create timeout listener function.
77
+ *
78
+ * @param {number} delay
79
+ * @param {function} cb
80
81
+ */
82
+
83
function onTimeout (delay, cb) {
84
return function () {
85
cb(createError(503, 'Response timeout', {
0 commit comments