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.
- package/dist/cjs/context.js +2 -2
- package/dist/context.js +2 -2
- package/dist/middleware/html/index.d.ts +2 -2
- package/dist/middleware/jsx/index.d.ts +7 -6
- package/dist/middleware/jsx/jsx-dev-runtime.d.ts +1 -1
- package/dist/request.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/validator/validator.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/context.js
CHANGED
|
@@ -170,10 +170,10 @@ class Context {
|
|
|
170
170
|
if (global?.fastly !== void 0) {
|
|
171
171
|
return "fastly";
|
|
172
172
|
}
|
|
173
|
-
if (typeof global?.EdgeRuntime
|
|
173
|
+
if (typeof global?.EdgeRuntime === "string") {
|
|
174
174
|
return "vercel";
|
|
175
175
|
}
|
|
176
|
-
if (global?.process?.
|
|
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
|
|
151
|
+
if (typeof global?.EdgeRuntime === "string") {
|
|
152
152
|
return "vercel";
|
|
153
153
|
}
|
|
154
|
-
if (global?.process?.
|
|
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:
|
|
3
|
-
export declare const html: (strings: TemplateStringsArray, ...values:
|
|
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]:
|
|
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:
|
|
13
|
+
props: Props;
|
|
13
14
|
children: Child[];
|
|
14
15
|
isEscaped: true;
|
|
15
|
-
constructor(tag: string | Function, props:
|
|
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:
|
|
21
|
-
declare type FC<T =
|
|
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?:
|
|
26
|
+
children?: Child[];
|
|
26
27
|
}) => 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,
|
|
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<
|
|
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]:
|
|
77
|
+
[x: string]: unknown;
|
|
78
78
|
}>>(req: R) => Promise<ValidateResult[]>;
|
|
79
79
|
protected getTypeRuleName(): string;
|
|
80
80
|
private sanitizeValue;
|