(t: UnionType)
| 403 | } |
| 404 | |
| 405 | export function nullableFromUnion(t: UnionType): Type | null { |
| 406 | const [hasNull, nonNulls] = removeNullFromUnion(t); |
| 407 | if (!hasNull) return null; |
| 408 | if (nonNulls.size !== 1) return null; |
| 409 | return defined(nonNulls.first()); |
| 410 | } |
| 411 | |
| 412 | export function nonNullTypeCases(t: Type): OrderedSet<Type> { |
| 413 | if (t.kind === "null") { |
no test coverage detected
searching dependent graphs…