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

Function parseModuleDeclaration

packages/tools/docgen/src/Parser.ts:441–468  ·  view source on GitHub ↗
(
  ed: ast.ModuleDeclaration
)

Source from the content-addressed store, hash-verified

439)
440
441const parseModuleDeclaration = (
442 ed: ast.ModuleDeclaration
443): Effect.Effect<Array<Domain.Namespace>, never, Source | Configuration.Configuration> => {
444 const doc = parseDoc(getJSDocText(ed.getJsDocs()))
445 if (shouldIgnore(doc)) {
446 return Effect.succeed([])
447 }
448 const name = ed.getName()
449 const getInterfaces = parseInterfaceDeclarations(ed.getInterfaces())
450 const getTypeAliases = parseTypeAliasDeclarations(ed.getTypeAliases())
451 const getNamespaces = parseModuleDeclarations(ed.getModules())
452 return Effect.gen(function*() {
453 const interfaces = yield* getInterfaces
454 const typeAliases = yield* getTypeAliases
455 const namespaces = yield* getNamespaces
456 const position = yield* parsePosition(ed)
457 return [
458 new Domain.Namespace(
459 name,
460 doc,
461 position,
462 interfaces,
463 typeAliases,
464 namespaces
465 )
466 ]
467 })
468}
469
470const parseModuleDeclarations = (namespaces: ReadonlyArray<ast.ModuleDeclaration>) => {
471 return Effect.forEach(

Callers

nothing calls this directly

Calls 7

parseDocFunction · 0.85
shouldIgnoreFunction · 0.85
parseModuleDeclarationsFunction · 0.85
parsePositionFunction · 0.85
succeedMethod · 0.45

Tested by

no test coverage detected