@jderstd/hono 0.7.1 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,59 +4,59 @@ declare const TIME_LIMIT_MAX_DEFAULT: 5000;
4
4
  /** Options for `timeLimit` middleware. */
5
5
  type TimeLimitOptions = {
6
6
  /**
7
- * Maximum time in milliseconds.
8
- *
9
- * By default, it is `TIME_LIMIT_MAX_DEFAULT`.
10
- */
7
+ * Maximum time in milliseconds.
8
+ *
9
+ * By default, it is `TIME_LIMIT_MAX_DEFAULT`.
10
+ */
11
11
  max?: number;
12
12
  };
13
13
  /**
14
- * Time limit middleware.
15
- *
16
- * Following error will be returned if the request takes longer than the limit:
17
- *
18
- * ```jsonc
19
- * // Status: 504
20
- * {
21
- * "success": false,
22
- * "errors": [
23
- * {
24
- * "code": "timeout",
25
- * "message": "Request timeout"
26
- * }
27
- * ]
28
- * }
29
- * ```
30
- *
31
- * For more information, please refer to
32
- * [Timeout](https://hono.dev/docs/middleware/builtin/timeout).
33
- *
34
- * ### Examples
35
- *
36
- * A example of using `timeLimit` middleware:
37
- *
38
- * ```ts
39
- * import { Hono } from "hono";
40
- * import { timeLimit } from "@jderstd/hono/time-limit";
41
- *
42
- * const app: Hono = new Hono();
43
- *
44
- * app.use(timeLimit());
45
- * ```
46
- *
47
- * A example of using `timeLimit` middleware with options:
48
- *
49
- * ```ts
50
- * import { Hono } from "hono";
51
- * import { timeLimit } from "@jderstd/hono/time-limit";
52
- *
53
- * const app: Hono = new Hono();
54
- *
55
- * app.use(timeLimit({
56
- * max: 10 * 1000, // 10s
57
- * }));
58
- * ```
59
- */
14
+ * Time limit middleware.
15
+ *
16
+ * Following error will be returned if the request takes longer than the limit:
17
+ *
18
+ * ```jsonc
19
+ * // Status: 504
20
+ * {
21
+ * "success": false,
22
+ * "errors": [
23
+ * {
24
+ * "code": "timeout",
25
+ * "message": "Request timeout"
26
+ * }
27
+ * ]
28
+ * }
29
+ * ```
30
+ *
31
+ * For more information, please refer to
32
+ * [Timeout](https://hono.dev/docs/middleware/builtin/timeout).
33
+ *
34
+ * ### Examples
35
+ *
36
+ * A example of using `timeLimit` middleware:
37
+ *
38
+ * ```ts
39
+ * import { Hono } from "hono";
40
+ * import { timeLimit } from "@jderstd/hono/time-limit";
41
+ *
42
+ * const app: Hono = new Hono();
43
+ *
44
+ * app.use(timeLimit());
45
+ * ```
46
+ *
47
+ * A example of using `timeLimit` middleware with options:
48
+ *
49
+ * ```ts
50
+ * import { Hono } from "hono";
51
+ * import { timeLimit } from "@jderstd/hono/time-limit";
52
+ *
53
+ * const app: Hono = new Hono();
54
+ *
55
+ * app.use(timeLimit({
56
+ * max: 10 * 1000, // 10s
57
+ * }));
58
+ * ```
59
+ */
60
60
  declare const timeLimit: (options?: TimeLimitOptions) => MiddlewareHandler;
61
61
  export { TIME_LIMIT_MAX_DEFAULT, type TimeLimitOptions, timeLimit };
62
62
  //# sourceMappingURL=time-limit.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jderstd/hono",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "A response builder for Hono",
5
5
  "keywords": [
6
6
  "jder",
@@ -73,8 +73,8 @@
73
73
  "dist"
74
74
  ],
75
75
  "dependencies": {
76
- "@jderstd/core": "~0.4.0",
77
- "ts-vista": "~0.2.2"
76
+ "@jderstd/core": "~0.5.0",
77
+ "ts-vista": "~0.2.3"
78
78
  },
79
79
  "devDependencies": {
80
80
  "hono": "4.5.0"