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

Function IsOptionalChainRoot

internal/ast/utilities.go:362–364  ·  view source on GitHub ↗

Determines if node is the root expression of an OptionalChain

(node *Expression)

Source from the content-addressed store, hash-verified

360
361// Determines if node is the root expression of an OptionalChain
362func IsOptionalChainRoot(node *Expression) bool {
363 return IsOptionalChain(node) && !IsNonNullExpression(node) && getQuestionDotToken(node) != nil
364}
365
366// Determines whether a node is the outermost `OptionalChain` in an ECMAScript `OptionalExpression`:
367//

Callers 5

getThisArgumentTypeMethod · 0.92
bindOptionalChainMethod · 0.92
IsOutermostOptionalChainFunction · 0.85

Calls 3

IsOptionalChainFunction · 0.85
IsNonNullExpressionFunction · 0.85
getQuestionDotTokenFunction · 0.85

Tested by

no test coverage detected