Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/validator/validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type {
ErrorHandler,
ExtractSchema,
ExtractSchemaForStatusCode,
FormValue,
MiddlewareHandler,
ParsedFormValue,
TypedResponse,
ValidationTargets,
} from '../types'
Expand Down Expand Up @@ -954,7 +954,7 @@ it('With path parameters', () => {
$put: {
input: {
form: {
title: ParsedFormValue | ParsedFormValue[]
title: FormValue | FormValue[]
}
} & {
param: {
Expand Down Expand Up @@ -1000,7 +1000,7 @@ it('`on`', () => {
$purge: {
input: {
form: {
tag: ParsedFormValue | ParsedFormValue[]
tag: FormValue | FormValue[]
}
} & {
query: {
Expand Down
6 changes: 3 additions & 3 deletions src/validator/validator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Context } from '../context'
import { getCookie } from '../helper/cookie'
import { HTTPException } from '../http-exception'
import type { Env, MiddlewareHandler, TypedResponse, ValidationTargets } from '../types'
import type { Env, MiddlewareHandler, TypedResponse, ValidationTargets, FormValue } from '../types'
import type { BodyData } from '../utils/body'
import { bufferToFormData } from '../utils/buffer'

Expand Down Expand Up @@ -66,7 +66,7 @@ export const validator = <
? unknown extends InputType
? ExtractValidatorOutput<VF>
: InputType
: { [K2 in keyof ExtractValidatorOutput<VF>]: ValidationTargets[K][K2] }
: { [K2 in keyof ExtractValidatorOutput<VF>]: ValidationTargets<FormValue>[K][K2] }
}
out: { [K in U]: ExtractValidatorOutput<VF> }
} = {
Expand All @@ -75,7 +75,7 @@ export const validator = <
? unknown extends InputType
? ExtractValidatorOutput<VF>
: InputType
: { [K2 in keyof ExtractValidatorOutput<VF>]: ValidationTargets[K][K2] }
: { [K2 in keyof ExtractValidatorOutput<VF>]: ValidationTargets<FormValue>[K][K2] }
}
out: { [K in U]: ExtractValidatorOutput<VF> }
},
Expand Down
Loading