MCPcopy Create free account
hub / github.com/Effect-TS/effect / parseFunctionDeclaration

Function parseFunctionDeclaration

packages/tools/docgen/src/Parser.ts:201–219  ·  view source on GitHub ↗
(fd: ast.FunctionDeclaration)

Source from the content-addressed store, hash-verified

199}
200
201const parseFunctionDeclaration = (fd: ast.FunctionDeclaration) =>
202 Effect.gen(function*() {
203 const doc = parseDoc(getJSDocText(getFunctionDeclarationJSDocs(fd)))
204 if (shouldIgnore(doc)) {
205 return []
206 }
207 const name = fd.getName()
208 const type = parseType(fd)
209 const signature = `declare const ${name}: ${type}`
210 const position = yield* parsePosition(fd)
211 return [
212 new Domain.Function(
213 name ?? "",
214 doc,
215 signature,
216 position
217 )
218 ]
219 })
220
221const parseFunctionVariableDeclaration = (vd: ast.VariableDeclaration) =>
222 Effect.gen(function*() {

Callers

nothing calls this directly

Calls 5

parseDocFunction · 0.85
shouldIgnoreFunction · 0.85
parseTypeFunction · 0.85
parsePositionFunction · 0.85

Tested by

no test coverage detected