Skip to content

Commit 670ea8f

Browse files
authored
docs-util: maintain support for Zod v3 and v4 (#15138)
1 parent 6a958d2 commit 670ea8f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

www/utils/packages/docs-generator/src/utils/is-zod-object.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ export default function isZodObject(itemType: ts.Type): boolean {
1111
return false
1212
}
1313

14-
return (parent.typeName as ts.Identifier).getText().includes("Prettify")
14+
// `Prettify` for Zod v4 and `identity` for Zod v3
15+
return (
16+
(parent.typeName as ts.Identifier).getText().includes("Prettify") ||
17+
(parent.typeName as ts.Identifier).getText().includes("identity")
18+
)
1519
}

0 commit comments

Comments
 (0)