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

Function IsAsyncFunction

internal/ast/utilities.go:4415–4422  ·  view source on GitHub ↗
(node *Node)

Source from the content-addressed store, hash-verified

4413}
4414
4415func IsAsyncFunction(node *Node) bool {
4416 switch node.Kind {
4417 case KindFunctionDeclaration, KindFunctionExpression, KindArrowFunction, KindMethodDeclaration:
4418 data := node.BodyData()
4419 return data.Body != nil && data.AsteriskToken == nil && HasSyntacticModifier(node, ModifierFlagsAsync)
4420 }
4421 return false
4422}
4423
4424/**
4425 * Gets the most likely element type for a TypeNode. This is not an exhaustive test

Calls 2

HasSyntacticModifierFunction · 0.85
BodyDataMethod · 0.65

Tested by

no test coverage detected