Skip to content

Commit

Permalink
handle usage of subnamespaced types in api check (#1952)
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolk authored Sep 3, 2024
1 parent 6ee7d08 commit 0135b3c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ type SomeTypeUnderSubNamespace = {
someOtherProperty: string;
}

type SomeOtherTypeUnderSubNamespace = {
someProperty: SomeTypeUnderSubNamespace;
};

declare namespace someSubNamespace {
export {
SomeTypeUnderSubNamespace
SomeTypeUnderSubNamespace,
SomeOtherTypeUnderSubNamespace
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export type SomeTypeUnderSubNamespace = {
someOtherProperty: string;
};

export type SomeOtherTypeUnderSubNamespace = {
someProperty: SomeTypeUnderSubNamespace;
};
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class UsageStatementsRenderer {

// characters that can be found before or after symbol
// this is to prevent partial matches in case one symbol's characters are subset of longer one
const symbolTerminators = '[\\s\\,\\(\\)<>]';
const symbolTerminators = '[\\s\\,\\(\\)<>;]';
const regex = new RegExp(
`(${symbolTerminators})(${symbolName})(${symbolTerminators})`,
'g'
Expand Down

0 comments on commit 0135b3c

Please sign in to comment.