Comparing version 4.3.0 to 4.3.1
import type { Context } from './context'; | ||
import type { Hono } from './hono'; | ||
import type { StatusCode } from './utils/http-status'; | ||
import type { IfAnyThenEmptyObject, JSONValue, Prettify, RemoveBlankRecord, UnionToIntersection } from './utils/types'; | ||
import type { IfAnyThenEmptyObject, IsAny, JSONValue, Prettify, RemoveBlankRecord, Simplify, UnionToIntersection } from './utils/types'; | ||
export type Bindings = Record<string, unknown>; | ||
@@ -12,2 +12,3 @@ export type Variables = Record<string, unknown>; | ||
export type Next = () => Promise<void>; | ||
export type ExtractInput<I extends Input | Input['in']> = I extends Input ? unknown extends I['in'] ? {} : I['in'] : I; | ||
export type Input = { | ||
@@ -365,12 +366,23 @@ in?: {}; | ||
type ExtractKey<S> = S extends Record<infer Key, unknown> ? Key extends string ? Key : never : string; | ||
export type ToSchema<M extends string, P extends string, I extends Input, R extends TypedResponse> = Prettify<{ | ||
export type ToSchema<M extends string, P extends string, I extends Input | Input['in'], RorO> = Prettify<{ | ||
[K in P]: { | ||
[K2 in M as AddDollar<K2>]: R extends TypedResponse<infer T, infer U, infer F> ? { | ||
input: unknown extends I['in'] ? AddParam<{}, P> : AddParam<I['in'], P>; | ||
[K2 in M as AddDollar<K2>]: Simplify<{ | ||
input: AddParam<ExtractInput<I>, P>; | ||
} & (IsAny<RorO> extends true ? { | ||
output: {}; | ||
outputFormat: ResponseFormat; | ||
status: StatusCode; | ||
} : RorO extends TypedResponse<infer T, infer U, infer F> ? { | ||
output: unknown extends T ? {} : T; | ||
outputFormat: I extends { | ||
outputFormat: string; | ||
} ? I['outputFormat'] : unknown extends F ? never : F; | ||
} ? I['outputFormat'] : F; | ||
status: U; | ||
} : never; | ||
} : { | ||
output: unknown extends RorO ? {} : RorO; | ||
outputFormat: unknown extends RorO ? 'json' : I extends { | ||
outputFormat: string; | ||
} ? I['outputFormat'] : 'json'; | ||
status: StatusCode; | ||
})>; | ||
}; | ||
@@ -377,0 +389,0 @@ }>; |
{ | ||
"name": "hono", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "Ultrafast web framework for the Edges", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
812577
22678