hono 4.8.10 → 4.8.11

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.
@@ -5,7 +5,7 @@ var handle = (app, opts = {
5
5
  return (evt) => {
6
6
  evt.respondWith(
7
7
  (async () => {
8
- const res = await app.fetch(evt.request);
8
+ const res = await app.fetch(evt.request, evt);
9
9
  if (opts.fetch && res.status === 404) {
10
10
  return await opts.fetch(evt.request);
11
11
  }
@@ -27,7 +27,7 @@ const handle = (app, opts = {
27
27
  return (evt) => {
28
28
  evt.respondWith(
29
29
  (async () => {
30
- const res = await app.fetch(evt.request);
30
+ const res = await app.fetch(evt.request, evt);
31
31
  if (opts.fetch && res.status === 404) {
32
32
  return await opts.fetch(evt.request);
33
33
  }
@@ -92,10 +92,10 @@ interface NewResponse {
92
92
  * Interface for responding with a body.
93
93
  */
94
94
  interface BodyRespond {
95
- <U extends ContentfulStatusCode>(data: Data, status?: U, headers?: HeaderRecord): Response & TypedResponse<unknown, U, "body">;
96
- <U extends StatusCode>(data: null, status?: U, headers?: HeaderRecord): Response & TypedResponse<null, U, "body">;
97
- <U extends ContentfulStatusCode>(data: Data, init?: ResponseOrInit<U>): Response & TypedResponse<unknown, U, "body">;
98
- <U extends StatusCode>(data: null, init?: ResponseOrInit<U>): Response & TypedResponse<null, U, "body">;
95
+ <T extends Data, U extends ContentfulStatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<T, U, "body">;
96
+ <T extends Data, U extends ContentfulStatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<T, U, "body">;
97
+ <T extends null, U extends StatusCode>(data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse<null, U, "body">;
98
+ <T extends null, U extends StatusCode>(data: T, init?: ResponseOrInit<U>): Response & TypedResponse<null, U, "body">;
99
99
  }
100
100
  /**
101
101
  * Interface for responding with text.
@@ -6,7 +6,7 @@ import type { Context } from '../../context';
6
6
  export type Runtime = "node" | "deno" | "bun" | "workerd" | "fastly" | "edge-light" | "other";
7
7
  export declare const env: <T extends Record<string, unknown>, C extends Context = Context<{
8
8
  Bindings: T;
9
- }>>(c: T extends Record<string, unknown> ? Context : C, runtime?: Runtime) => T & C["env"];
9
+ }, any, {}>>(c: T extends Record<string, unknown> ? Context : C, runtime?: Runtime) => T & C["env"];
10
10
  export declare const knownUserAgents: Partial<Record<Runtime, string>>;
11
11
  export declare const getRuntimeKey: () => Runtime;
12
12
  export declare const checkUserAgentEquals: (platform: string) => boolean;
@@ -1,4 +1,3 @@
1
- import { GET_MATCH_RESULT } from './request/constants';
2
1
  import type { Result } from './router';
3
2
  import type { Input, InputToDataByTarget, ParamKeyToRecord, ParamKeys, RemoveQuestion, RouterRoute, ValidationTargets } from './types';
4
3
  import type { BodyData, ParseBodyOptions } from './utils/body';
@@ -15,10 +14,6 @@ type BodyCache = Partial<Body & {
15
14
  parsedBody: BodyData;
16
15
  }>;
17
16
  export declare class HonoRequest<P extends string = "/", I extends Input["out"] = {}> {
18
- [GET_MATCH_RESULT]: Result<[
19
- unknown,
20
- RouterRoute
21
- ]>;
22
17
  /**
23
18
  * `.raw` can get the raw Request object.
24
19
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.8.10",
3
+ "version": "4.8.11",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",
@@ -656,7 +656,7 @@
656
656
  "nodejs"
657
657
  ],
658
658
  "devDependencies": {
659
- "@hono/eslint-config": "^1.0.2",
659
+ "@hono/eslint-config": "^2.0.3",
660
660
  "@hono/node-server": "^1.13.5",
661
661
  "@types/glob": "^8.1.0",
662
662
  "@types/jsdom": "^21.1.7",