( ed: ast.ModuleDeclaration )
| 439 | ) |
| 440 | |
| 441 | const 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 | |
| 470 | const parseModuleDeclarations = (namespaces: ReadonlyArray<ast.ModuleDeclaration>) => { |
| 471 | return Effect.forEach( |
nothing calls this directly
no test coverage detected