Skip to content

Commit

Permalink
fix(docs): remove spaces in type parameter brackets (#10127)
Browse files Browse the repository at this point in the history
* fix(docs): remove spaces in type parameter brackets

* fix: missing global flag
  • Loading branch information
Qjuh committed Feb 11, 2024
1 parent 36db77f commit ce6b2b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/api-extractor/src/generators/ExcerptBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ export class ExcerptBuilder {
// Remove BarTokens from excerpts if they immediately follow a LessThanToken, e.g. `Promise< | Something>`
// would become `Promise<Something>`
if (/<(?:\s*\||\s+)/.test(prevToken.text)) {
prevToken.text = prevToken.text.replace(/<\s*\|?\s*/, '<');
prevToken.text = prevToken.text.replaceAll(/<\s*\|?\s*/g, '<');
}

if (/\s+>/.test(prevToken.text)) {
prevToken.text = prevToken.text.replace(/\s*>/, '>');
prevToken.text = prevToken.text.replaceAll(/\s*>/g, '>');
}

mergeCount = 1;
Expand Down

0 comments on commit ce6b2b7

Please sign in to comment.