hono 4.7.8 → 4.7.10

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.
@@ -105,7 +105,7 @@ const setSignedCookie = async (c, name, value, secret, opt) => {
105
105
  c.header("set-cookie", cookie, { append: true });
106
106
  };
107
107
  const deleteCookie = (c, name, opt) => {
108
- const deletedCookie = getCookie(c, name);
108
+ const deletedCookie = getCookie(c, name, opt?.prefix);
109
109
  setCookie(c, name, "", { ...opt, maxAge: 0 });
110
110
  return deletedCookie;
111
111
  };
@@ -240,7 +240,9 @@ const toSSG = async (app, fs, options) => {
240
240
  return;
241
241
  }
242
242
  for (const content of getContentGen) {
243
- savePromises.push(saveContentToFile(content, fs, outputDir).catch((e) => e));
243
+ savePromises.push(
244
+ saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e)
245
+ );
244
246
  }
245
247
  })
246
248
  );
@@ -98,6 +98,8 @@ class Hono {
98
98
  router: this.router,
99
99
  getPath: this.getPath
100
100
  });
101
+ clone.errorHandler = this.errorHandler;
102
+ clone.#notFoundHandler = this.#notFoundHandler;
101
103
  clone.routes = this.routes;
102
104
  return clone;
103
105
  }
@@ -119,7 +119,7 @@ const verifyFromJwks = async (token, options, init) => {
119
119
  if (!matchingKey) {
120
120
  throw new import_types.JwtTokenInvalid(token);
121
121
  }
122
- return await verify(token, matchingKey, matchingKey.alg);
122
+ return await verify(token, matchingKey, matchingKey.alg || header.alg);
123
123
  };
124
124
  const decode = (token) => {
125
125
  try {
@@ -79,7 +79,7 @@ var setSignedCookie = async (c, name, value, secret, opt) => {
79
79
  c.header("set-cookie", cookie, { append: true });
80
80
  };
81
81
  var deleteCookie = (c, name, opt) => {
82
- const deletedCookie = getCookie(c, name);
82
+ const deletedCookie = getCookie(c, name, opt?.prefix);
83
83
  setCookie(c, name, "", { ...opt, maxAge: 0 });
84
84
  return deletedCookie;
85
85
  };
@@ -212,7 +212,9 @@ var toSSG = async (app, fs, options) => {
212
212
  return;
213
213
  }
214
214
  for (const content of getContentGen) {
215
- savePromises.push(saveContentToFile(content, fs, outputDir).catch((e) => e));
215
+ savePromises.push(
216
+ saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e)
217
+ );
216
218
  }
217
219
  })
218
220
  );
package/dist/hono-base.js CHANGED
@@ -76,6 +76,8 @@ var Hono = class {
76
76
  router: this.router,
77
77
  getPath: this.getPath
78
78
  });
79
+ clone.errorHandler = this.errorHandler;
80
+ clone.#notFoundHandler = this.#notFoundHandler;
79
81
  clone.routes = this.routes;
80
82
  return clone;
81
83
  }
@@ -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
- }, any, {}>>(c: T extends Record<string, unknown> ? Context : C, runtime?: Runtime) => T & C["env"];
9
+ }>>(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;
@@ -7,12 +7,12 @@ import type { Cookie, CookieOptions, CookiePrefixOptions, SignedCookie } from '.
7
7
  interface GetCookie {
8
8
  (c: Context, key: string): string | undefined;
9
9
  (c: Context): Cookie;
10
- (c: Context, key: string, prefixOptions: CookiePrefixOptions): string | undefined;
10
+ (c: Context, key: string, prefixOptions?: CookiePrefixOptions): string | undefined;
11
11
  }
12
12
  interface GetSignedCookie {
13
13
  (c: Context, secret: string | BufferSource, key: string): Promise<string | undefined | false>;
14
- (c: Context, secret: string): Promise<SignedCookie>;
15
- (c: Context, secret: string | BufferSource, key: string, prefixOptions: CookiePrefixOptions): Promise<string | undefined | false>;
14
+ (c: Context, secret: string | BufferSource): Promise<SignedCookie>;
15
+ (c: Context, secret: string | BufferSource, key: string, prefixOptions?: CookiePrefixOptions): Promise<string | undefined | false>;
16
16
  }
17
17
  export declare const getCookie: GetCookie;
18
18
  export declare const getSignedCookie: GetSignedCookie;
@@ -100,7 +100,7 @@ var verifyFromJwks = async (token, options, init) => {
100
100
  if (!matchingKey) {
101
101
  throw new JwtTokenInvalid(token);
102
102
  }
103
- return await verify(token, matchingKey, matchingKey.alg);
103
+ return await verify(token, matchingKey, matchingKey.alg || header.alg);
104
104
  };
105
105
  var decode = (token) => {
106
106
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "4.7.8",
3
+ "version": "4.7.10",
4
4
  "description": "Web framework built on Web Standards",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",