Skip to content

Commit

Permalink
apply same restrictions for required(...) & partial(...) masks.
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Nov 16, 2022
1 parent bd0c300 commit c6e7b08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions deno/lib/types.ts
Expand Up @@ -2059,8 +2059,8 @@ export class ZodObject<
UnknownKeys,
Catchall
>;
partial<Mask extends { [k in keyof T]?: true }>(
mask: Mask
partial<Mask extends objectKeyMask<T>>(
mask: optionalPickWith<Mask, objectKeyMask<T>>
): ZodObject<
objectUtil.noNever<{
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
Expand Down Expand Up @@ -2100,8 +2100,8 @@ export class ZodObject<
UnknownKeys,
Catchall
>;
required<Mask extends { [k in keyof T]?: true }>(
mask: Mask
required<Mask extends objectKeyMask<T>>(
mask: optionalPickWith<Mask, objectKeyMask<T>>
): ZodObject<
objectUtil.noNever<{
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
Expand Down
8 changes: 4 additions & 4 deletions src/types.ts
Expand Up @@ -2059,8 +2059,8 @@ export class ZodObject<
UnknownKeys,
Catchall
>;
partial<Mask extends { [k in keyof T]?: true }>(
mask: Mask
partial<Mask extends objectKeyMask<T>>(
mask: optionalPickWith<Mask, objectKeyMask<T>>
): ZodObject<
objectUtil.noNever<{
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
Expand Down Expand Up @@ -2100,8 +2100,8 @@ export class ZodObject<
UnknownKeys,
Catchall
>;
required<Mask extends { [k in keyof T]?: true }>(
mask: Mask
required<Mask extends objectKeyMask<T>>(
mask: optionalPickWith<Mask, objectKeyMask<T>>
): ZodObject<
objectUtil.noNever<{
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
Expand Down

0 comments on commit c6e7b08

Please sign in to comment.