mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
Clean up helpers which are always present in ES2020 (#55515)
This commit is contained in:
@@ -52,8 +52,6 @@ import {
|
||||
SyntaxKind,
|
||||
TemplateExpression,
|
||||
TextSpan,
|
||||
trimString,
|
||||
trimStringStart,
|
||||
TryStatement,
|
||||
} from "./_namespaces/ts";
|
||||
|
||||
@@ -164,11 +162,11 @@ const regionDelimiterRegExp = /^#(end)?region(?:\s+(.*))?(?:\r)?$/;
|
||||
function isRegionDelimiter(lineText: string) {
|
||||
// We trim the leading whitespace and // without the regex since the
|
||||
// multiple potential whitespace matches can make for some gnarly backtracking behavior
|
||||
lineText = trimStringStart(lineText);
|
||||
lineText = lineText.trimStart();
|
||||
if (!startsWith(lineText, "//")) {
|
||||
return null; // eslint-disable-line no-null/no-null
|
||||
}
|
||||
lineText = trimString(lineText.slice(2));
|
||||
lineText = lineText.slice(2).trim();
|
||||
return regionDelimiterRegExp.exec(lineText);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user