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

Function parseExportStar

packages/tools/docgen/src/Parser.ts:398–416  ·  view source on GitHub ↗
(ed: ast.ExportDeclaration)

Source from the content-addressed store, hash-verified

396 })
397
398const parseExportStar = (ed: ast.ExportDeclaration) =>
399 Effect.gen(function*() {
400 const es = ed.getModuleSpecifier()!
401 const name = es.getText()
402 const namespace = ed.getNamespaceExport()?.getName()
403 const signature = `export *${namespace === undefined ? "" : ` as ${namespace}`} from ${name}`
404 const oDocComment = getDocComment(ed.getLeadingCommentRanges())
405 const doc = Option.isSome(oDocComment) ? parseDoc(oDocComment.value.getText()) : parseDoc("")
406 const position = yield* parsePosition(ed)
407 return new Domain.Export(
408 namespace ?? name,
409 doc.modifyDescription(
410 `Re-exports all named exports from the ${name} module${namespace === undefined ? "" : ` as \`${namespace}\``}.`
411 ),
412 signature,
413 position,
414 true
415 )
416 })
417
418const parseNamedExports = (ed: ast.ExportDeclaration) => {
419 const namedExports = ed.getNamedExports()

Callers 1

parseNamedExportsFunction · 0.85

Calls 4

getDocCommentFunction · 0.85
parseDocFunction · 0.85
parsePositionFunction · 0.85
modifyDescriptionMethod · 0.80

Tested by

no test coverage detected