We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec15603 commit c559d47Copy full SHA for c559d47
src/utils.ts
@@ -158,7 +158,10 @@ export function tsArrayOf(type: string): string {
158
/** X & Y & Z; */
159
export function tsIntersectionOf(...types: string[]): string {
160
if (types.length === 1) return String(types[0]); // don’t add parentheses around one thing
161
- return types.map((t) => (TS_UNION_INTERSECTION_RE.test(t) ? `(${t})` : t)).join(" & ");
+ return types
162
+ .filter((t) => t !== "unknown")
163
+ .map((t) => (TS_UNION_INTERSECTION_RE.test(t) ? `(${t})` : t))
164
+ .join(" & ");
165
}
166
167
/** NonNullable<T> */
0 commit comments