hono 4.4.8 → 4.4.9

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.
package/README.md CHANGED
@@ -25,8 +25,7 @@
25
25
  [![codecov](https://codecov.io/github/honojs/hono/graph/badge.svg)](https://codecov.io/github/honojs/hono)
26
26
  [![Discord badge](https://img.shields.io/discord/1011308539819597844?label=Discord&logo=Discord)](https://discord.gg/KMh2eNSdxV)
27
27
 
28
- Hono - _**\[炎\] means flame🔥 in Japanese**_ - is a small, simple, and ultrafast web framework for the Edges.
29
- It works on any JavaScript runtime: Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js.
28
+ Hono - _**means flame🔥 in Japanese**_ - is a small, simple, and ultrafast web framework built on Web Standards. It works on any JavaScript runtime: Cloudflare Workers, Fastly Compute, Deno, Bun, Vercel, AWS Lambda, Lambda@Edge, and Node.js.
30
29
 
31
30
  Fast, but not only fast.
32
31
 
@@ -41,7 +40,7 @@ export default app
41
40
 
42
41
  ## Quick Start
43
42
 
44
- ```
43
+ ```bash
45
44
  npm create hono@latest
46
45
  ```
47
46
 
@@ -22,6 +22,7 @@ __export(context_exports, {
22
22
  TEXT_PLAIN: () => TEXT_PLAIN
23
23
  });
24
24
  module.exports = __toCommonJS(context_exports);
25
+ var import_request = require("./request");
25
26
  var import_html = require("./utils/html");
26
27
  const TEXT_PLAIN = "text/plain; charset=UTF-8";
27
28
  const setHeaders = (headers, map = {}) => {
@@ -29,30 +30,37 @@ const setHeaders = (headers, map = {}) => {
29
30
  return headers;
30
31
  };
31
32
  class Context {
32
- req;
33
+ #rawRequest;
34
+ #req;
33
35
  env = {};
34
- _var;
36
+ #var;
35
37
  finalized = false;
36
- error = void 0;
38
+ error;
37
39
  #status = 200;
38
40
  #executionCtx;
39
- #headers = void 0;
40
- #preparedHeaders = void 0;
41
+ #headers;
42
+ #preparedHeaders;
41
43
  #res;
42
44
  #isFresh = true;
43
- layout = void 0;
44
- renderer = (content) => this.html(content);
45
- notFoundHandler = () => new Response();
45
+ #layout;
46
+ #renderer;
47
+ #notFoundHandler;
48
+ #matchResult;
49
+ #path;
46
50
  constructor(req, options) {
47
- this.req = req;
51
+ this.#rawRequest = req;
48
52
  if (options) {
49
53
  this.#executionCtx = options.executionCtx;
50
54
  this.env = options.env;
51
- if (options.notFoundHandler) {
52
- this.notFoundHandler = options.notFoundHandler;
53
- }
55
+ this.#notFoundHandler = options.notFoundHandler;
56
+ this.#path = options.path;
57
+ this.#matchResult = options.matchResult;
54
58
  }
55
59
  }
60
+ get req() {
61
+ this.#req ??= new import_request.HonoRequest(this.#rawRequest, this.#path, this.#matchResult);
62
+ return this.#req;
63
+ }
56
64
  get event() {
57
65
  if (this.#executionCtx && "respondWith" in this.#executionCtx) {
58
66
  return this.#executionCtx;
@@ -90,11 +98,14 @@ class Context {
90
98
  this.#res = _res;
91
99
  this.finalized = true;
92
100
  }
93
- render = (...args) => this.renderer(...args);
94
- setLayout = (layout) => this.layout = layout;
95
- getLayout = () => this.layout;
101
+ render = (...args) => {
102
+ this.#renderer ??= (content) => this.html(content);
103
+ return this.#renderer(...args);
104
+ };
105
+ setLayout = (layout) => this.#layout = layout;
106
+ getLayout = () => this.#layout;
96
107
  setRenderer = (renderer) => {
97
- this.renderer = renderer;
108
+ this.#renderer = renderer;
98
109
  };
99
110
  header = (name, value, options) => {
100
111
  if (value === void 0) {
@@ -136,14 +147,14 @@ class Context {
136
147
  this.#status = status;
137
148
  };
138
149
  set = (key, value) => {
139
- this._var ??= {};
140
- this._var[key] = value;
150
+ this.#var ??= {};
151
+ this.#var[key] = value;
141
152
  };
142
153
  get = (key) => {
143
- return this._var ? this._var[key] : void 0;
154
+ return this.#var ? this.#var[key] : void 0;
144
155
  };
145
156
  get var() {
146
- return { ...this._var };
157
+ return { ...this.#var };
147
158
  }
148
159
  newResponse = (data, arg, headers) => {
149
160
  if (this.#isFresh && !headers && !arg && this.#status === 200) {
@@ -238,7 +249,8 @@ class Context {
238
249
  return this.newResponse(null, status ?? 302);
239
250
  };
240
251
  notFound = () => {
241
- return this.notFoundHandler(this);
252
+ this.#notFoundHandler ??= () => new Response();
253
+ return this.#notFoundHandler(this);
242
254
  };
243
255
  }
244
256
  // Annotate the CommonJS export names for ESM import in node:
@@ -24,7 +24,6 @@ __export(hono_base_exports, {
24
24
  module.exports = __toCommonJS(hono_base_exports);
25
25
  var import_compose = require("./compose");
26
26
  var import_context = require("./context");
27
- var import_request = require("./request");
28
27
  var import_router = require("./router");
29
28
  var import_url = require("./utils/url");
30
29
  const COMPOSED_HANDLER = Symbol("composedHandler");
@@ -198,7 +197,9 @@ class Hono {
198
197
  }
199
198
  const path = this.getPath(request, { env });
200
199
  const matchResult = this.matchRoute(method, path);
201
- const c = new import_context.Context(new import_request.HonoRequest(request, path, matchResult), {
200
+ const c = new import_context.Context(request, {
201
+ path,
202
+ matchResult,
202
203
  env,
203
204
  executionCtx,
204
205
  notFoundHandler: this.notFoundHandler
@@ -46,6 +46,9 @@ const timing = (config) => {
46
46
  return async function timing2(c, next) {
47
47
  const headers = [];
48
48
  const timers = /* @__PURE__ */ new Map();
49
+ if (c.get("metric")) {
50
+ return await next();
51
+ }
49
52
  c.set("metric", { headers, timers });
50
53
  if (options.total) {
51
54
  startTime(c, "total", options.totalDescription);
package/dist/context.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/context.ts
2
+ import { HonoRequest } from "./request.js";
2
3
  import { HtmlEscapedCallbackPhase, resolveCallback } from "./utils/html.js";
3
4
  var TEXT_PLAIN = "text/plain; charset=UTF-8";
4
5
  var setHeaders = (headers, map = {}) => {
@@ -6,30 +7,37 @@ var setHeaders = (headers, map = {}) => {
6
7
  return headers;
7
8
  };
8
9
  var Context = class {
9
- req;
10
+ #rawRequest;
11
+ #req;
10
12
  env = {};
11
- _var;
13
+ #var;
12
14
  finalized = false;
13
- error = void 0;
15
+ error;
14
16
  #status = 200;
15
17
  #executionCtx;
16
- #headers = void 0;
17
- #preparedHeaders = void 0;
18
+ #headers;
19
+ #preparedHeaders;
18
20
  #res;
19
21
  #isFresh = true;
20
- layout = void 0;
21
- renderer = (content) => this.html(content);
22
- notFoundHandler = () => new Response();
22
+ #layout;
23
+ #renderer;
24
+ #notFoundHandler;
25
+ #matchResult;
26
+ #path;
23
27
  constructor(req, options) {
24
- this.req = req;
28
+ this.#rawRequest = req;
25
29
  if (options) {
26
30
  this.#executionCtx = options.executionCtx;
27
31
  this.env = options.env;
28
- if (options.notFoundHandler) {
29
- this.notFoundHandler = options.notFoundHandler;
30
- }
32
+ this.#notFoundHandler = options.notFoundHandler;
33
+ this.#path = options.path;
34
+ this.#matchResult = options.matchResult;
31
35
  }
32
36
  }
37
+ get req() {
38
+ this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult);
39
+ return this.#req;
40
+ }
33
41
  get event() {
34
42
  if (this.#executionCtx && "respondWith" in this.#executionCtx) {
35
43
  return this.#executionCtx;
@@ -67,11 +75,14 @@ var Context = class {
67
75
  this.#res = _res;
68
76
  this.finalized = true;
69
77
  }
70
- render = (...args) => this.renderer(...args);
71
- setLayout = (layout) => this.layout = layout;
72
- getLayout = () => this.layout;
78
+ render = (...args) => {
79
+ this.#renderer ??= (content) => this.html(content);
80
+ return this.#renderer(...args);
81
+ };
82
+ setLayout = (layout) => this.#layout = layout;
83
+ getLayout = () => this.#layout;
73
84
  setRenderer = (renderer) => {
74
- this.renderer = renderer;
85
+ this.#renderer = renderer;
75
86
  };
76
87
  header = (name, value, options) => {
77
88
  if (value === void 0) {
@@ -113,14 +124,14 @@ var Context = class {
113
124
  this.#status = status;
114
125
  };
115
126
  set = (key, value) => {
116
- this._var ??= {};
117
- this._var[key] = value;
127
+ this.#var ??= {};
128
+ this.#var[key] = value;
118
129
  };
119
130
  get = (key) => {
120
- return this._var ? this._var[key] : void 0;
131
+ return this.#var ? this.#var[key] : void 0;
121
132
  };
122
133
  get var() {
123
- return { ...this._var };
134
+ return { ...this.#var };
124
135
  }
125
136
  newResponse = (data, arg, headers) => {
126
137
  if (this.#isFresh && !headers && !arg && this.#status === 200) {
@@ -215,7 +226,8 @@ var Context = class {
215
226
  return this.newResponse(null, status ?? 302);
216
227
  };
217
228
  notFound = () => {
218
- return this.notFoundHandler(this);
229
+ this.#notFoundHandler ??= () => new Response();
230
+ return this.#notFoundHandler(this);
219
231
  };
220
232
  };
221
233
  export {
package/dist/hono-base.js CHANGED
@@ -1,7 +1,6 @@
1
1
  // src/hono-base.ts
2
2
  import { compose } from "./compose.js";
3
3
  import { Context } from "./context.js";
4
- import { HonoRequest } from "./request.js";
5
4
  import { METHODS, METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE } from "./router.js";
6
5
  import { getPath, getPathNoStrict, mergePath } from "./utils/url.js";
7
6
  var COMPOSED_HANDLER = Symbol("composedHandler");
@@ -175,7 +174,9 @@ var Hono = class {
175
174
  }
176
175
  const path = this.getPath(request, { env });
177
176
  const matchResult = this.matchRoute(method, path);
178
- const c = new Context(new HonoRequest(request, path, matchResult), {
177
+ const c = new Context(request, {
178
+ path,
179
+ matchResult,
179
180
  env,
180
181
  executionCtx,
181
182
  notFoundHandler: this.notFoundHandler
@@ -21,6 +21,9 @@ var timing = (config) => {
21
21
  return async function timing2(c, next) {
22
22
  const headers = [];
23
23
  const timers = /* @__PURE__ */ new Map();
24
+ if (c.get("metric")) {
25
+ return await next();
26
+ }
24
27
  c.set("metric", { headers, timers });
25
28
  if (options.total) {
26
29
  startTime(c, "total", options.totalDescription);
@@ -1,5 +1,6 @@
1
- import type { HonoRequest } from './request';
2
- import type { Env, FetchEventLike, Input, NotFoundHandler, TypedResponse } from './types';
1
+ import { HonoRequest } from './request';
2
+ import type { Result } from './router';
3
+ import type { Env, FetchEventLike, H, Input, NotFoundHandler, RouterRoute, TypedResponse } from './types';
3
4
  import type { RedirectStatusCode, StatusCode } from './utils/http-status';
4
5
  import type { IsAny, JSONParsed, JSONValue, SimplifyDeepArray } from './utils/types';
5
6
  type HeaderRecord = Record<string, string | string[]>;
@@ -154,14 +155,12 @@ type ContextOptions<E extends Env> = {
154
155
  * Handler for not found responses.
155
156
  */
156
157
  notFoundHandler?: NotFoundHandler<E>;
158
+ matchResult?: Result<[H, RouterRoute]>;
159
+ path?: string;
157
160
  };
158
161
  export declare const TEXT_PLAIN = "text/plain; charset=UTF-8";
159
162
  export declare class Context<E extends Env = any, P extends string = any, I extends Input = {}> {
160
163
  #private;
161
- /**
162
- * `.req` is the instance of {@link HonoRequest}.
163
- */
164
- req: HonoRequest<P, I['out']>;
165
164
  /**
166
165
  * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.
167
166
  *
@@ -176,7 +175,6 @@ export declare class Context<E extends Env = any, P extends string = any, I exte
176
175
  * ```
177
176
  */
178
177
  env: E['Bindings'];
179
- private _var;
180
178
  finalized: boolean;
181
179
  /**
182
180
  * `.error` can get the error object from the middleware if the Handler throws an error.
@@ -194,16 +192,17 @@ export declare class Context<E extends Env = any, P extends string = any, I exte
194
192
  * ```
195
193
  */
196
194
  error: Error | undefined;
197
- private layout;
198
- private renderer;
199
- private notFoundHandler;
200
195
  /**
201
196
  * Creates an instance of the Context class.
202
197
  *
203
- * @param req - The HonoRequest object.
198
+ * @param req - The Request object.
204
199
  * @param options - Optional configuration options for the context.
205
200
  */
206
- constructor(req: HonoRequest<P, I['out']>, options?: ContextOptions<E>);
201
+ constructor(req: Request, options?: ContextOptions<E>);
202
+ /**
203
+ * `.req` is the instance of {@link HonoRequest}.
204
+ */
205
+ get req(): HonoRequest<P, I['out']>;
207
206
  /**
208
207
  * @see {@link https://hono.dev/api/context#event}
209
208
  * The FetchEvent associated with the current request.
@@ -258,7 +257,7 @@ export declare class Context<E extends Env = any, P extends string = any, I exte
258
257
  *
259
258
  * @returns The current layout function.
260
259
  */
261
- getLayout: () => Layout<{
260
+ getLayout: () => Layout<PropsForRenderer & {
262
261
  Layout: Layout;
263
262
  }> | undefined;
264
263
  /**
@@ -38,18 +38,18 @@ export interface HTTPResponseError extends Error {
38
38
  export type ErrorHandler<E extends Env = any> = (err: Error | HTTPResponseError, c: Context<E>) => Response | Promise<Response>;
39
39
  export interface HandlerInterface<E extends Env = Env, M extends string = string, S extends Schema = BlankSchema, BasePath extends string = '/'> {
40
40
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, I extends Input = BlankInput, R extends HandlerResponse<any> = any, E2 extends Env = E>(handler: H<E2, P, I, R>): Hono<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath>;
41
- <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, E2 extends Env = E>(path: P, handler: H<E2, MergedPath, I, R>): Hono<IntersectNonAnyTypes<[E, E2]>, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>;
41
+ <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, E2 extends Env = E>(path: P, handler: H<E2, MergedPath, I, R>): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>;
42
42
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, I extends Input = BlankInput, I2 extends Input = I, R extends HandlerResponse<any> = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(...handlers: [H<E2, P, I>, H<E3, P, I2, R>]): Hono<IntersectNonAnyTypes<[E, E2, E3]>, S & ToSchema<M, P, I2, MergeTypedResponse<R>>, BasePath>;
43
- <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>]): Hono<IntersectNonAnyTypes<[E, E2, E3]>, S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath>;
43
+ <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2, R>]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I2, MergeTypedResponse<R>>, BasePath>;
44
44
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = E, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(...handlers: [H<E2, P, I>, H<E3, P, I2>, H<E4, P, I3, R>]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4]>, S & ToSchema<M, P, I3, MergeTypedResponse<R>>, BasePath>;
45
- <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = E, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4]>, S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath>;
45
+ <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = E, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(path: P, ...handlers: [H<E2, MergedPath, I>, H<E3, MergedPath, I2>, H<E4, MergedPath, I3, R>]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I3, MergeTypedResponse<R>>, BasePath>;
46
46
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(...handlers: [H<E2, P, I>, H<E3, P, I2>, H<E4, P, I3>, H<E5, P, I4, R>]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S & ToSchema<M, P, I4, MergeTypedResponse<R>>, BasePath>;
47
47
  <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(path: P, ...handlers: [
48
48
  H<E2, MergedPath, I>,
49
49
  H<E3, MergedPath, I2>,
50
50
  H<E4, MergedPath, I3>,
51
51
  H<E5, MergedPath, I4, R>
52
- ]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath>;
52
+ ]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I4, MergeTypedResponse<R>>, BasePath>;
53
53
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(...handlers: [H<E2, P, I>, H<E3, P, I2>, H<E4, P, I3>, H<E5, P, I4>, H<E6, P, I5, R>]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S & ToSchema<M, P, I5, MergeTypedResponse<R>>, BasePath>;
54
54
  <P extends string, MergedPath extends MergePath<BasePath, P> = MergePath<BasePath, P>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(path: P, ...handlers: [
55
55
  H<E2, MergedPath, I>,
@@ -57,7 +57,7 @@ export interface HandlerInterface<E extends Env = Env, M extends string = string
57
57
  H<E4, MergedPath, I3>,
58
58
  H<E5, MergedPath, I4>,
59
59
  H<E6, MergedPath, I5, R>
60
- ]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath>;
60
+ ]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I5, MergeTypedResponse<R>>, BasePath>;
61
61
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = E, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(...handlers: [
62
62
  H<E2, P, I>,
63
63
  H<E3, P, I2>,
@@ -73,7 +73,7 @@ export interface HandlerInterface<E extends Env = Env, M extends string = string
73
73
  H<E5, MergedPath, I4>,
74
74
  H<E6, MergedPath, I5>,
75
75
  H<E7, MergedPath, I6, R>
76
- ]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath>;
76
+ ]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I6, MergeTypedResponse<R>>, BasePath>;
77
77
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = E, E7 extends Env = E, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(...handlers: [
78
78
  H<E2, P, I>,
79
79
  H<E3, P, I2>,
@@ -91,7 +91,7 @@ export interface HandlerInterface<E extends Env = Env, M extends string = string
91
91
  H<E6, MergedPath, I5>,
92
92
  H<E7, MergedPath, I6>,
93
93
  H<E8, MergedPath, I7, R>
94
- ]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath>;
94
+ ]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I7, MergeTypedResponse<R>>, BasePath>;
95
95
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = E, E7 extends Env = E, E8 extends Env = E, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(...handlers: [
96
96
  H<E2, P, I>,
97
97
  H<E3, P, I2>,
@@ -111,7 +111,7 @@ export interface HandlerInterface<E extends Env = Env, M extends string = string
111
111
  H<E7, MergedPath, I6>,
112
112
  H<E8, MergedPath, I7>,
113
113
  H<E9, MergedPath, I8, R>
114
- ]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath>;
114
+ ]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I8, MergeTypedResponse<R>>, BasePath>;
115
115
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = E, E7 extends Env = E, E8 extends Env = E, E9 extends Env = E, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(...handlers: [
116
116
  H<E2, P, I>,
117
117
  H<E3, P, I2>,
@@ -133,7 +133,7 @@ export interface HandlerInterface<E extends Env = Env, M extends string = string
133
133
  H<E8, MergedPath, I7>,
134
134
  H<E9, MergedPath, I8>,
135
135
  H<E10, MergedPath, I9, R>
136
- ]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<R>>, BasePath>;
136
+ ]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I9, MergeTypedResponse<R>>, BasePath>;
137
137
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, R extends HandlerResponse<any> = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = E, E4 extends Env = E, E5 extends Env = E, E6 extends Env = E, E7 extends Env = E, E8 extends Env = E, E9 extends Env = E, E10 extends Env = E, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(...handlers: [
138
138
  H<E2, P, I>,
139
139
  H<E3, P, I2>,
@@ -157,7 +157,7 @@ export interface HandlerInterface<E extends Env = Env, M extends string = string
157
157
  H<E9, MergedPath, I8>,
158
158
  H<E10, MergedPath, I9>,
159
159
  H<E11, MergedPath, I10, R>
160
- ]): Hono<IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11]>, S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<R>>, BasePath>;
160
+ ]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I10, MergeTypedResponse<R>>, BasePath>;
161
161
  <P extends string = ExtractKey<S> extends never ? BasePath : ExtractKey<S>, I extends Input = BlankInput, R extends HandlerResponse<any> = any>(...handlers: H<E, P, I, R>[]): Hono<E, S & ToSchema<M, P, I, MergeTypedResponse<R>>, BasePath>;
162
162
  <P extends string, I extends Input = BlankInput, R extends HandlerResponse<any> = any>(path: P, ...handlers: H<E, MergePath<BasePath, P>, I, R>[]): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>;
163
163
  <P extends string, R extends HandlerResponse<any> = any, I extends Input = BlankInput>(path: P): Hono<E, S & ToSchema<M, MergePath<BasePath, P>, I, MergeTypedResponse<R>>, BasePath>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.4.8",
4
- "description": "Ultrafast web framework for the Edges",
3
+ "version": "4.4.9",
4
+ "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
7
7
  "module": "dist/index.js",