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

Function parseMethod

packages/tools/docgen/src/Parser.ts:491–513  ·  view source on GitHub ↗
(md: ast.MethodDeclaration)

Source from the content-addressed store, hash-verified

489 tps.length === 0 ? "" : `<${tps.map((p) => p.getName()).join(", ")}>`
490
491const parseMethod = (md: ast.MethodDeclaration) =>
492 Effect.gen(function*() {
493 const name = md.getName()
494 const jsdocs = Array.matchLeft(md.getOverloads(), {
495 onEmpty: () => md.getJsDocs(),
496 onNonEmpty: (head) => head.getJsDocs()
497 })
498 const doc = parseDoc(getJSDocText(jsdocs))
499 if (shouldIgnore(doc)) {
500 return Option.none()
501 }
502 const type = parseType(md)
503 const signature = `declare const ${name}: ${type}`
504 const position = yield* parsePosition(md)
505 return Option.some(
506 new Domain.DocEntry(
507 name,
508 doc,
509 signature,
510 position
511 )
512 )
513 })
514
515const parseProperty = (pd: ast.PropertyDeclaration) =>
516 Effect.gen(function*() {

Callers

nothing calls this directly

Calls 5

parseDocFunction · 0.85
shouldIgnoreFunction · 0.85
parseTypeFunction · 0.85
parsePositionFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected