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

Function bucketDeclarations

packages/tools/api-diff/src/Snapshot.ts:563–575  ·  view source on GitHub ↗
(symbol: ts.Symbol, bucket: Bucket)

Source from the content-addressed store, hash-verified

561}
562
563const bucketDeclarations = (symbol: ts.Symbol, bucket: Bucket): ReadonlyArray<ts.Declaration> => {
564 const declarations = symbol.declarations ?? []
565 return declarations.filter((declaration) => {
566 if (bucket === "type") {
567 return ts.isInterfaceDeclaration(declaration) || ts.isTypeAliasDeclaration(declaration) ||
568 ts.isClassDeclaration(declaration) || ts.isEnumDeclaration(declaration) ||
569 ts.isModuleDeclaration(declaration)
570 }
571 return ts.isFunctionDeclaration(declaration) || ts.isVariableDeclaration(declaration) ||
572 ts.isClassDeclaration(declaration) || ts.isEnumDeclaration(declaration) ||
573 ts.isModuleDeclaration(declaration) || ts.isExportAssignment(declaration)
574 })
575}
576
577const symbolBuckets = (symbol: ts.Symbol): ReadonlyArray<Bucket> => {
578 const output: Array<Bucket> = []

Callers 1

collectExportsFunction · 0.85

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected