Skip to content

Commit 210ffc4

Browse files
committed
fix
1 parent 11bda7e commit 210ffc4

File tree

5 files changed

+1684
-847
lines changed

5 files changed

+1684
-847
lines changed

lib/utils/type-tracker/tracker.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)