hono 2.5.7 → 2.5.8

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.
@@ -170,10 +170,10 @@ class Context {
170
170
  if (global?.fastly !== void 0) {
171
171
  return "fastly";
172
172
  }
173
- if (typeof global?.EdgeRuntime !== "string") {
173
+ if (typeof global?.EdgeRuntime === "string") {
174
174
  return "vercel";
175
175
  }
176
- if (global?.process?.title === "node") {
176
+ if (global?.process?.release?.name === "node") {
177
177
  return "node";
178
178
  }
179
179
  return "other";
package/dist/context.js CHANGED
@@ -148,10 +148,10 @@ var Context = class {
148
148
  if (global?.fastly !== void 0) {
149
149
  return "fastly";
150
150
  }
151
- if (typeof global?.EdgeRuntime !== "string") {
151
+ if (typeof global?.EdgeRuntime === "string") {
152
152
  return "vercel";
153
153
  }
154
- if (global?.process?.title === "node") {
154
+ if (global?.process?.release?.name === "node") {
155
155
  return "node";
156
156
  }
157
157
  return "other";
@@ -1,3 +1,3 @@
1
1
  import type { HtmlEscapedString } from '../../utils/html';
2
- export declare const raw: (value: any) => HtmlEscapedString;
3
- export declare const html: (strings: TemplateStringsArray, ...values: any[]) => HtmlEscapedString;
2
+ export declare const raw: (value: unknown) => HtmlEscapedString;
3
+ export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => HtmlEscapedString;
@@ -1,26 +1,27 @@
1
1
  import type { StringBuffer, HtmlEscaped, HtmlEscapedString } from '../../utils/html';
2
+ declare type Props = Record<string, any>;
2
3
  declare global {
3
4
  namespace jsx.JSX {
4
5
  interface IntrinsicElements {
5
- [tagName: string]: Record<string, any>;
6
+ [tagName: string]: Props;
6
7
  }
7
8
  }
8
9
  }
9
10
  declare type Child = string | number | JSXNode | Child[];
10
11
  export declare class JSXNode implements HtmlEscaped {
11
12
  tag: string | Function;
12
- props: Record<string, any>;
13
+ props: Props;
13
14
  children: Child[];
14
15
  isEscaped: true;
15
- constructor(tag: string | Function, props: Record<string, any>, children: Child[]);
16
+ constructor(tag: string | Function, props: Props, children: Child[]);
16
17
  toString(): string;
17
18
  toStringToBuffer(buffer: StringBuffer): void;
18
19
  }
19
20
  export { jsxFn as jsx };
20
- declare const jsxFn: (tag: string | Function, props: Record<string, any>, ...children: (string | HtmlEscapedString)[]) => JSXNode;
21
- declare type FC<T = Record<string, any>> = (props: T) => HtmlEscapedString;
21
+ declare const jsxFn: (tag: string | Function, props: Props, ...children: (string | HtmlEscapedString)[]) => JSXNode;
22
+ declare type FC<T = Props> = (props: T) => HtmlEscapedString;
22
23
  export declare const memo: <T>(component: FC<T>, propsAreEqual?: (prevProps: Readonly<T>, nextProps: Readonly<T>) => boolean) => FC<T>;
23
24
  export declare const Fragment: (props: {
24
25
  key?: string;
25
- children?: any;
26
+ children?: Child[];
26
27
  }) => JSXNode;
@@ -1,3 +1,3 @@
1
1
  import type { JSXNode } from '.';
2
2
  export { Fragment } from '.';
3
- export declare function jsxDEV(tag: string | Function, props: Record<string, any>): JSXNode;
3
+ export declare function jsxDEV(tag: string | Function, props: Record<string, unknown>): JSXNode;
package/dist/request.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { BodyData } from './utils/body';
2
2
  import type { Cookie } from './utils/cookie';
3
- declare type ValidatedData = Record<string, any>;
3
+ declare type ValidatedData = Record<string, unknown>;
4
4
  declare global {
5
5
  interface Request<CfHostMetadata = unknown, ParamKeyType extends string = string, Data extends ValidatedData = ValidatedData> {
6
6
  paramData?: Record<ParamKeyType, string>;
package/dist/types.d.ts CHANGED
@@ -20,7 +20,7 @@ export interface CustomHandler<P extends string | Partial<Environment> | Schema
20
20
  (c: Context<P extends string ? P : P extends Partial<Environment> ? string : P extends Partial<Schema> ? string : never, P extends Partial<Environment> ? P : P extends Partial<Schema> ? Partial<Environment> : E extends Partial<Environment> ? E extends Partial<Schema> ? Environment : E : E extends Partial<Schema> ? Partial<Environment> : Environment, S extends Schema ? S : P extends Schema ? P : E extends Schema ? E : any>, next: Next): Response | Promise<Response | undefined | void>;
21
21
  }
22
22
  export interface ExecutionContext {
23
- waitUntil(promise: Promise<any>): void;
23
+ waitUntil(promise: Promise<void>): void;
24
24
  passThroughOnException(): void;
25
25
  }
26
26
  export {};
@@ -74,7 +74,7 @@ export declare abstract class VBase {
74
74
  asBoolean: () => VBoolean | VBooleanArray;
75
75
  get(value: string): this;
76
76
  validate: <R extends Request<unknown, string, {
77
- [x: string]: any;
77
+ [x: string]: unknown;
78
78
  }>>(req: R) => Promise<ValidateResult[]>;
79
79
  protected getTypeRuleName(): string;
80
80
  private sanitizeValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hono",
3
- "version": "2.5.7",
3
+ "version": "2.5.8",
4
4
  "description": "Ultrafast web framework for Cloudflare Workers, Deno, and Bun.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "type": "module",