CodeQL library for JavaScript/TypeScript
codeql/javascript-all 2.0.1-dev (changelog, source)
Search

Member predicate UnionOrIntersectionTypeExpr::getAnUnderlyingType

Repeatedly unfolds unions, intersections, parentheses, and nullability/readonly modifiers and gets any of the underlying types, or this type itself if it cannot be unfolded.

Note that this only unfolds the syntax of the type annotation. Type aliases are not followed to their definition.

TypeExpr getAnUnderlyingType()