Skip to content

Commit 7dfac9c

Browse files
committed
Ref: combining conditions in onObject producer.
1 parent ce6463e commit 7dfac9c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

express-zod-api/src/zts.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ const onObject: Producer = (
9393
([key, value]) => {
9494
const isOptional = isResponse
9595
? value._zod.def.type === "optional"
96-
: value._zod.def.type === "promise"
97-
? false
98-
: value instanceof z.ZodType && value.isOptional();
96+
: value._zod.def.type !== "promise" &&
97+
value instanceof z.ZodType &&
98+
value.isOptional();
9999
const { description: comment, deprecated: isDeprecated } =
100100
globalRegistry.get(value) || {};
101101
return makeInterfaceProp(key, next(value), {

0 commit comments

Comments
 (0)