Skip to content

Commit 1ee0e41

Browse files
authored
Merge pull request #1306 from kimzuni/fix/validator-check-type-guard
fix(types): preserve type narrowing in getSchemaValidator
2 parents 6309b3e + b7664b2 commit 1ee0e41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ export const getSchemaValidator = <T extends TSchema | string | undefined>(
709709
validators?: InputSchema['body'][]
710710
sanitize?: () => ExactMirrorInstruction['sanitize']
711711
} = {}
712-
): T extends TSchema ? ElysiaTypeCheck<TSchema> : undefined => {
712+
): T extends TSchema ? ElysiaTypeCheck<T> : undefined => {
713713
validators = validators?.filter((x) => x)
714714

715715
if (!s) {

0 commit comments

Comments
 (0)