mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 05:43:11 -05:00
perf: replace String and Array indexOf method calls with includes method call (#55482)
This commit is contained in:
@@ -104,7 +104,6 @@ import {
|
||||
returnTrue,
|
||||
ScriptTarget,
|
||||
startsWith,
|
||||
stringContains,
|
||||
StringLiteral,
|
||||
SyntaxKind,
|
||||
sys,
|
||||
@@ -1710,7 +1709,7 @@ export function parseListTypeOption(opt: CommandLineOptionOfListType, value = ""
|
||||
if (startsWith(value, "-")) {
|
||||
return undefined;
|
||||
}
|
||||
if (opt.type === "listOrElement" && !stringContains(value, ",")) {
|
||||
if (opt.type === "listOrElement" && !value.includes(",")) {
|
||||
return validateJsonOptionValue(opt, value, errors);
|
||||
}
|
||||
if (value === "") {
|
||||
@@ -3078,7 +3077,7 @@ function parseConfig(
|
||||
basePath = normalizeSlashes(basePath);
|
||||
const resolvedPath = getNormalizedAbsolutePath(configFileName || "", basePath);
|
||||
|
||||
if (resolutionStack.indexOf(resolvedPath) >= 0) {
|
||||
if (resolutionStack.includes(resolvedPath)) {
|
||||
errors.push(createCompilerDiagnostic(Diagnostics.Circularity_detected_while_resolving_configuration_Colon_0, [...resolutionStack, resolvedPath].join(" -> ")));
|
||||
return { raw: json || convertToObject(sourceFile!, errors) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user