Skip to content

Commit 4a1cdb6

Browse files
committed
fix: also exclude any from null union
1 parent 1c139c7 commit 4a1cdb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/server/templates/typescript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ export const apply = async ({
484484

485485
function generateNullableUnionTsType(tsType: string, isNullable: boolean) {
486486
// Only add the null union if the type is not unknown as unknown already includes null
487-
if (tsType === 'unknown' || !isNullable) {
487+
if (tsType === 'unknown' || tsType === 'any' || !isNullable) {
488488
return tsType
489489
}
490490
return `${tsType} | null`

0 commit comments

Comments
 (0)