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

Function parseProperty

packages/tools/docgen/src/Parser.ts:515–540  ·  view source on GitHub ↗
(pd: ast.PropertyDeclaration)

Source from the content-addressed store, hash-verified

513 })
514
515const parseProperty = (pd: ast.PropertyDeclaration) =>
516 Effect.gen(function*() {
517 const doc = parseDoc(getJSDocText(pd.getJsDocs()))
518 if (shouldIgnore(doc)) {
519 return []
520 }
521 const name = pd.getName()
522 const type = parseType(pd)
523 const readonly = pipe(
524 Option.fromNullishOr(pd.getFirstModifierByKind(ast.ts.SyntaxKind.ReadonlyKeyword)),
525 Option.match({
526 onNone: () => "",
527 onSome: () => "readonly "
528 })
529 )
530 const signature = `${readonly}${name}: ${type}`
531 const position = yield* parsePosition(pd)
532 return [
533 new Domain.DocEntry(
534 name,
535 doc,
536 signature,
537 position
538 )
539 ]
540 })
541
542const parseProperties = (c: ast.ClassDeclaration) => {
543 const properties = Array.filter(

Callers

nothing calls this directly

Calls 5

parseDocFunction · 0.85
shouldIgnoreFunction · 0.85
parseTypeFunction · 0.85
parsePositionFunction · 0.85
pipeFunction · 0.50

Tested by

no test coverage detected