MCPcopy Create free account
hub / github.com/babel/babel / FunctionTypeAnnotation

Function FunctionTypeAnnotation

packages/babel-generator/src/node/parentheses.ts:88–103  ·  view source on GitHub ↗
(
  node: t.FunctionTypeAnnotation,
  parent: any,
  parentId: number,
  tokenContext: number,
)

Source from the content-addressed store, hash-verified

86}
87
88export function FunctionTypeAnnotation(
89 node: t.FunctionTypeAnnotation,
90 parent: any,
91 parentId: number,
92 tokenContext: number,
93): boolean {
94 return (
95 // (() => A) | (() => B)
96 parentId === __node("UnionTypeAnnotation") ||
97 // (() => A) & (() => B)
98 parentId === __node("IntersectionTypeAnnotation") ||
99 // (() => A)[]
100 parentId === __node("ArrayTypeAnnotation") ||
101 (tokenContext & TokenContext.arrowFlowReturnType) > 0
102 );
103}
104
105export function UpdateExpression(
106 node: t.UpdateExpression,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected