@@ -95,6 +95,13 @@ export class CollectorEntity {
95
95
return false ;
96
96
}
97
97
98
+ /**
99
+ * Indicates that this entity is exported from the package entry point. Compare to `CollectorEntity.exported`.
100
+ */
101
+ public get exportedFromEntryPoint ( ) : boolean {
102
+ return this . exportNames . size > 0 ;
103
+ }
104
+
98
105
/**
99
106
* Indicates that this entity is exported from its parent module (i.e. either the package entry point or
100
107
* a local namespace). Compare to `CollectorEntity.consumable`.
@@ -116,7 +123,7 @@ export class CollectorEntity {
116
123
*/
117
124
public get exported ( ) : boolean {
118
125
// Exported from top-level?
119
- if ( this . exportNames . size > 0 ) return true ;
126
+ if ( this . exportedFromEntryPoint ) return true ;
120
127
121
128
// Exported from parent?
122
129
for ( const localExportNames of this . _localExportNamesByParent . values ( ) ) {
@@ -156,7 +163,7 @@ export class CollectorEntity {
156
163
*/
157
164
public get consumable ( ) : boolean {
158
165
// Exported from top-level?
159
- if ( this . exportNames . size > 0 ) return true ;
166
+ if ( this . exportedFromEntryPoint ) return true ;
160
167
161
168
// Exported from consumable parent?
162
169
for ( const [ parent , localExportNames ] of this . _localExportNamesByParent ) {
@@ -168,27 +175,6 @@ export class CollectorEntity {
168
175
return false ;
169
176
}
170
177
171
- /**
172
- * Whether the entity has any parent entities.
173
- *
174
- * @remarks
175
- * In the example below:
176
- *
177
- * ```ts
178
- * declare function add(): void;
179
- * declare namespace calculator {
180
- * export {
181
- * add
182
- * }
183
- * }
184
- * ```
185
- *
186
- * The `CollectorEntity` for `calculator` is the parent of the `CollectorEntity` for `add`.
187
- */
188
- public get hasParents ( ) : boolean {
189
- return this . _localExportNamesByParent . size > 0 ;
190
- }
191
-
192
178
/**
193
179
* Adds a new export name to the entity.
194
180
*/
0 commit comments