Skip to content

Commit

Permalink
Make input type equal to output type in z.custom
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhacks committed Apr 18, 2024
1 parent 78e5cde commit 7d1197c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deno/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5079,7 +5079,7 @@ export function custom<T>(
*
*/
fatal?: boolean
): ZodType<T, ZodTypeDef, unknown> {
): ZodType<T, ZodTypeDef, T> {
if (check)
return ZodAny.create().superRefine((data, ctx) => {
if (!check(data)) {
Expand Down
2 changes: 0 additions & 2 deletions playground.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { z } from "./src";

z;

console.log(z.string().ip().parse("255.255.255.255"));
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5079,7 +5079,7 @@ export function custom<T>(
*
*/
fatal?: boolean
): ZodType<T, ZodTypeDef, unknown> {
): ZodType<T, ZodTypeDef, T> {
if (check)
return ZodAny.create().superRefine((data, ctx) => {
if (!check(data)) {
Expand Down

0 comments on commit 7d1197c

Please sign in to comment.