mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Make regexp a constant
This commit is contained in:
@@ -83,8 +83,9 @@ namespace ts.OutliningElementsCollector {
|
||||
}
|
||||
}
|
||||
|
||||
const regionDelimiterRegExp = /^\s*\/\/\s*#(end)?region(?:\s+(.*))?(?:\r)?$/;
|
||||
function isRegionDelimiter(lineText: string) {
|
||||
return lineText.match(/^\s*\/\/\s*#(end)?region(?:\s+(.*))?(?:\r)?$/);
|
||||
return regionDelimiterRegExp.exec(lineText);
|
||||
}
|
||||
|
||||
function addOutliningForLeadingCommentsForNode(n: Node, sourceFile: SourceFile, cancellationToken: CancellationToken, out: Push<OutliningSpan>): void {
|
||||
|
||||
Reference in New Issue
Block a user