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

Function wrapInFlowComment

packages/babel-plugin-transform-flow-comments/src/index.ts:71–86  ·  view source on GitHub ↗
(path: NodePath<N>)

Source from the content-addressed store, hash-verified

69 }
70
71 function wrapInFlowComment<
72 N extends
73 | t.ClassProperty
74 | t.ExportNamedDeclaration
75 | t.Flow
76 | t.ImportDeclaration
77 | t.ExportDeclaration
78 | t.ImportSpecifier
79 | t.ImportDeclaration,
80 >(path: NodePath<N>) {
81 attachComment({
82 ofPath: path,
83 // @ts-expect-error optional may not exist in path.parent
84 comments: generateComment(path, path.parent.optional),
85 });
86 }
87
88 function generateComment(path: NodePath, optional?: boolean | void) {
89 let comment = path

Callers 4

ClassPropertyFunction · 0.85
ExportNamedDeclarationFunction · 0.85
ImportDeclarationFunction · 0.85
FlowFunction · 0.85

Calls 2

attachCommentFunction · 0.85
generateCommentFunction · 0.85

Tested by

no test coverage detected