File tree Expand file tree Collapse file tree 5 files changed +1684
-847
lines changed
tests/lib/utils/type-tracker Expand file tree Collapse file tree 5 files changed +1684
-847
lines changed Original file line number Diff line number Diff line change @@ -738,6 +738,23 @@ function jsDocTypeNodeToTypeInfo(
738738 if ( node . type === "JsdocTypeTypeof" ) {
739739 return new TypeFunction ( ( ) => jsDocTypeNodeToTypeInfo ( node . element ) )
740740 }
741+ if ( node . type === "JsdocTypeReadonlyArray" ) {
742+ return jsDocTypeNodeToTypeInfo ( node . element )
743+ }
744+ if ( node . type === "JsdocTypeConditional" ) {
745+ const trueType = jsDocTypeNodeToTypeInfo ( node . trueType )
746+ const falseType = jsDocTypeNodeToTypeInfo ( node . falseType )
747+ if ( trueType && falseType ) {
748+ return TypeUnionOrIntersection . buildType ( function * ( ) {
749+ yield trueType
750+ yield falseType
751+ } )
752+ }
753+ return trueType ?? falseType
754+ }
755+ if ( node . type === "JsdocTypeTemplateLiteral" ) {
756+ return STRING
757+ }
741758 if (
742759 node . type === "JsdocTypeAny" ||
743760 node . type === "JsdocTypeUnknown" ||
@@ -752,7 +769,8 @@ function jsDocTypeNodeToTypeInfo(
752769 node . type === "JsdocTypeNamePath" ||
753770 node . type === "JsdocTypePredicate" ||
754771 node . type === "JsdocTypeSpecialNamePath" ||
755- node . type === "JsdocTypeSymbol"
772+ node . type === "JsdocTypeSymbol" ||
773+ node . type === "JsdocTypeAssertsPlain"
756774 ) {
757775 return null
758776 }
You can’t perform that action at this time.
0 commit comments