MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getArrayOrTupleTargetType

Method getArrayOrTupleTargetType

internal/checker/checker.go:24056–24066  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

24054}
24055
24056func (c *Checker) getArrayOrTupleTargetType(node *ast.Node) *Type {
24057 readonly := c.isReadonlyTypeOperator(node.Parent)
24058 elementType := c.getArrayElementTypeNode(node)
24059 if elementType != nil {
24060 if readonly {
24061 return c.globalReadonlyArrayType
24062 }
24063 return c.globalArrayType
24064 }
24065 return c.getTupleTargetType(core.Map(node.Elements(), c.getTupleElementInfo), readonly)
24066}
24067
24068func (c *Checker) isReadonlyTypeOperator(node *ast.Node) bool {
24069 return ast.IsTypeOperatorNode(node) && node.AsTypeOperatorNode().Operator == ast.KindReadonlyKeyword

Callers 1

Calls 5

getTupleTargetTypeMethod · 0.95
MapFunction · 0.92
ElementsMethod · 0.45

Tested by

no test coverage detected