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

Method optionalChainContainsReference

internal/checker/flow.go:1830–1838  ·  view source on GitHub ↗
(source *ast.Node, target *ast.Node)

Source from the content-addressed store, hash-verified

1828}
1829
1830func (c *Checker) optionalChainContainsReference(source *ast.Node, target *ast.Node) bool {
1831 for ast.IsOptionalChain(source) {
1832 source = source.Expression()
1833 if c.isMatchingReference(source, target) {
1834 return true
1835 }
1836 }
1837 return false
1838}
1839
1840func (c *Checker) getReferenceCandidate(node *ast.Node) *ast.Node {
1841 switch node.Kind {

Callers 8

narrowTypeByTypeofMethod · 0.95
getTypeAtSwitchClauseMethod · 0.95
hasMatchingArgumentMethod · 0.95

Calls 3

isMatchingReferenceMethod · 0.95
IsOptionalChainFunction · 0.92
ExpressionMethod · 0.80

Tested by

no test coverage detected