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

Function parseConstantVariableDeclaration

packages/tools/docgen/src/Parser.ts:329–348  ·  view source on GitHub ↗
(vd: ast.VariableDeclaration)

Source from the content-addressed store, hash-verified

327)
328
329const parseConstantVariableDeclaration = (vd: ast.VariableDeclaration) =>
330 Effect.gen(function*() {
331 const vs: any = vd.getParent().getParent()
332 const doc = parseDoc(getJSDocText(vs.getJsDocs()))
333 if (shouldIgnore(doc)) {
334 return []
335 }
336 const name = vd.getName()
337 const type = parseType(vd)
338 const signature = `declare const ${name}: ${type}`
339 const position = yield* parsePosition(vd)
340 return [
341 new Domain.Constant(
342 name,
343 doc,
344 signature,
345 position
346 )
347 ]
348 })
349
350/**
351 * Parses exported non-function constants from the current source file.

Callers

nothing calls this directly

Calls 4

parseDocFunction · 0.85
shouldIgnoreFunction · 0.85
parseTypeFunction · 0.85
parsePositionFunction · 0.85

Tested by

no test coverage detected