Skip to content

Commit e6b00a9

Browse files
committed
Improve RegExp based on PR feedback
1 parent 4bad602 commit e6b00a9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/api-extractor/src/generators/packageTypings/PackageTypingsGenerator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class PackageTypingsGenerator {
133133
indentedWriter.clear();
134134

135135
for (const analyzeWarning of this._analyzeWarnings) {
136-
indentedWriter.writeLine('// ' + analyzeWarning);
136+
indentedWriter.writeLine('// Warning: ' + analyzeWarning);
137137
}
138138

139139
// If there is a @packagedocumentation header, put it first:
@@ -332,7 +332,9 @@ export class PackageTypingsGenerator {
332332

333333
let releaseTag: ReleaseTag = ReleaseTag.None;
334334

335-
const releaseTagRegExp: RegExp = /(?:\s|\*)@(internal|alpha|beta|public)/g;
335+
// We don't want to match "bill@example.com". But we do want to match "/**@public*/".
336+
// So for now we require whitespace or a star before/after the string.
337+
const releaseTagRegExp: RegExp = /(?:\s|\*)@(internal|alpha|beta|public)(?:\s|\*)/g;
336338

337339
for (const declaration of fullyFollowedSymbol.declarations || []) {
338340
const sourceFileText: string = declaration.getSourceFile().text;

0 commit comments

Comments
 (0)