Skip to content

Commit 841e2ce

Browse files
authored
fix(standard-validator): fix the type errors (#1830)
1 parent 0122860 commit 841e2ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/standard-validator/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ const sValidator = <
156156
return hookResult
157157
}
158158

159-
if ('response' in hookResult) {
159+
if (typeof hookResult === 'object' && 'response' in hookResult) {
160160
return hookResult.response
161161
}
162162
}
@@ -168,7 +168,7 @@ const sValidator = <
168168
return c.json({ data: value, error: processedIssues, success: false }, 400)
169169
}
170170

171-
return result.value as StandardSchemaV1.InferOutput<Schema>
171+
return (result as { value: StandardSchemaV1.InferOutput<Schema> }).value
172172
})
173173

174174
export type { Hook }

0 commit comments

Comments
 (0)