We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4224a28 commit d5da06cCopy full SHA for d5da06c
1 file changed
lib/process-schema.ts
@@ -126,6 +126,18 @@ export function schemaToType(
126
};
127
}
128
129
+ // already got a nullable type, no need to add null
130
+ if (types.some((t) => t === 'null')) {
131
+ return {
132
+ name,
133
+ hasQuestionToken,
134
+ type: intersect
135
+ ? // @ts-expect-error -> bad type in ts-morph (arguably)
136
+ Writers.intersectionType(...types)
137
+ : // @ts-expect-error -> bad type in ts-morph (arguably)
138
+ Writers.unionType(...types),
139
+ };
140
+ }
141
return {
142
name,
143
hasQuestionToken,
0 commit comments