Skip to content

Commit e236d70

Browse files
authored
fix: Properly handle visibility modifiers (#93)
1 parent 50f61d4 commit e236d70

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fixtures/test-utils/simple/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class TestUtilWrapper {
2929
*
3030
* Long Text.
3131
*/
32-
findObject(): TestReturnType {
32+
public findObject(): TestReturnType {
3333
return {
3434
key: 'value',
3535
};
@@ -39,5 +39,5 @@ export class TestUtilWrapper {
3939
private privateNoOp(): void {}
4040

4141
// And this function should not be included because it's protected
42-
private protectedNoOp(): void {}
42+
protected protectedNoOp(): void {}
4343
}

src/test-utils-new/extractor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function documentClass(
7878
const modifiers = (ts.canHaveModifiers(declaration) && ts.getModifiers(declaration)) || [];
7979
if (
8080
modifiers.find(
81-
modifier => modifier.kind & ts.SyntaxKind.ProtectedKeyword || modifier.kind & ts.SyntaxKind.PrivateKeyword
81+
modifier => modifier.kind === ts.SyntaxKind.ProtectedKeyword || modifier.kind === ts.SyntaxKind.PrivateKeyword
8282
)
8383
) {
8484
continue;

0 commit comments

Comments
 (0)