Update LKG

This commit is contained in:
TypeScript Bot
2024-02-19 05:58:57 +00:00
parent 8a1f79dca5
commit bd4f51c8f0
18 changed files with 1145 additions and 841 deletions
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Neočekávaný token",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Neočekávaný token. Očekával se konstruktor, metoda, přístupový objekt nebo vlastnost.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Neočekávaný token. Očekával se název parametru typu bez složených závorek.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Neočekávaný token. Měli jste na mysli {'>'} nebo >?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Neočekávaný token. Měli jste na mysli {'>'} nebo >?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Neočekávaný token. Měli jste na mysli {'}'} nebo }?",
"Unexpected_token_expected_1179": "Neočekávaný token. Očekává se znak {.",
"Unknown_build_option_0_5072": "Neznámá možnost sestavení {0}",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Unerwartetes Token.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Unerwartetes Token. Ein Konstruktor, eine Methode, eine Zugriffsmethode oder eine Eigenschaft wurde erwartet.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Unerwartetes Token. Es wurde ein Typparametername ohne geschweifte Klammern erwartet.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Unerwartetes Token. Meinten Sie \"{'>'}\" oder \">\"?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Unerwartetes Token. Meinten Sie \"{'>'}\" oder \">\"?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Unerwartetes Token. Meinten Sie \"{'}'}\" oder \"}\"?",
"Unexpected_token_expected_1179": "Unerwartetes Token. \"{\" wurde erwartet.",
"Unknown_build_option_0_5072": "Unbekannte Buildoption \"{0}\".",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Token inesperado.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token inesperado. Se esperaba un constructor, un método, un descriptor de acceso o una propiedad.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token inesperado. Se esperaba un nombre de parámetro de tipo sin llaves.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. ¿Pretendía usar \"{'>'}\" o \">\"?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. ¿Pretendía usar \"{'>'}\" o \">\"?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Token inesperado. ¿Pretendía usar \"{'}'}\" o \"}\"?",
"Unexpected_token_expected_1179": "Token inesperado. Se esperaba \"{\".",
"Unknown_build_option_0_5072": "Opción de compilación \"{0}\" desconocida.",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Jeton inattendu.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Jeton inattendu. Un constructeur, une méthode, un accesseur ou une propriété est attendu.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Jeton inattendu. Un nom de paramètre de type est attendu sans accolades.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Jeton inattendu. Est-ce que vous avez voulu utiliser '{'>'}' ou '>' ?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Jeton inattendu. Est-ce que vous avez voulu utiliser '{'>'}' ou '>' ?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Jeton inattendu. Est-ce que vous avez voulu utiliser '{'}'}' ou '}' ?",
"Unexpected_token_expected_1179": "Jeton inattendu. '{' est attendu.",
"Unknown_build_option_0_5072": "Option de build inconnue : '{0}'.",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Token imprevisto.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token imprevisto. È previsto un costruttore, un metodo, una funzione di accesso o una proprietà.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token imprevisto. Sono previsti nomi di parametro senza parentesi graffe.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Token imprevisto. Si intendeva `{'>'}` o `>`?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Token imprevisto. Si intendeva `{'>'}` o `>`?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Token imprevisto. Si intendeva `{'}'}` o `}`?",
"Unexpected_token_expected_1179": "Token imprevisto. È previsto '{'.",
"Unknown_build_option_0_5072": "L'opzione di compilazione '{0}' è sconosciuta.",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "予期しないトークンです。",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "予期しないトークンです。コンストラクター、メソッド、アクセサー、またはプロパティが必要です。",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "予期しないトークンです。型パラメーター名には、中かっこを含めることはできません。",
"Unexpected_token_Did_you_mean_or_gt_1382": "予期しないトークンです。`{'>'}` または `>` を意図していましたか?",
"Unexpected_token_Did_you_mean_or_gt_1382": "予期しないトークンです。`{'>'}` または `>` を意図していましたか?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "予期しないトークンです。`{'}'}` または `}` を意図していましたか?",
"Unexpected_token_expected_1179": "予期しないトークンです。'{' が必要です。",
"Unknown_build_option_0_5072": "'{0}' は不明なビルド オプションです。",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "예기치 않은 토큰입니다.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "예기치 않은 토큰입니다. 생성자, 메서드, 접근자 또는 속성이 필요합니다.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "예기치 않은 토큰입니다. 중괄호가 없는 형식 매개 변수 이름이 필요합니다.",
"Unexpected_token_Did_you_mean_or_gt_1382": "예기치 않은 토큰입니다. '{'>'}' 또는 '>'를 사용하시겠습니까?",
"Unexpected_token_Did_you_mean_or_gt_1382": "예기치 않은 토큰입니다. '{'>'}' 또는 '>'를 사용하시겠습니까?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "예기치 않은 토큰입니다. '{'}'}' 또는 '}'를 사용하시겠습니까?",
"Unexpected_token_expected_1179": "예기치 않은 토큰입니다. '{'가 있어야 합니다.",
"Unknown_build_option_0_5072": "알 수 없는 빌드 옵션 '{0}'입니다.",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Nieoczekiwany token.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Nieoczekiwany token. Oczekiwano konstruktora, metody, metody dostępu lub właściwości.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Nieoczekiwany token. Oczekiwano nazwy parametru typu bez nawiasów klamrowych.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Nieoczekiwany token. Czy chodziło o „{'>'}” lub „>”?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Nieoczekiwany token. Czy chodziło o „{'>'}” lub „>”?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Nieoczekiwany token. Czy chodziło o „{'}'}” lub „}”?",
"Unexpected_token_expected_1179": "Nieoczekiwany token. Oczekiwano znaku „{”.",
"Unknown_build_option_0_5072": "Nieznana opcja kompilacji „{0}”.",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Token inesperado.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Token inesperado. Um construtor, método, acessador ou propriedade era esperado.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Token inesperado. Era esperado um nome de parâmetro de tipo sem chaves.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. Você quis dizer '{'>'}' ou '>'?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Token inesperado. Você quis dizer '{'>'}' ou '>'?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Token inesperado. Você quis dizer '{'}'}' ou '}'?",
"Unexpected_token_expected_1179": "Token inesperado. '{' esperado.",
"Unknown_build_option_0_5072": "Opção de build '{0}' desconhecida.",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Неожиданный токен.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Неожиданный токен. Ожидался конструктор, метод, метод доступа или свойство.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Непредвиденная лексема. Ожидалось имя параметра типа без фигурных скобок.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Непредвиденный токен. Возможно, вы хотели использовать \"{'>'}\" или \">\"?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Непредвиденный токен. Возможно, вы хотели использовать \"{'>'}\" или \">\"?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Непредвиденный токен. Возможно, вы хотели использовать \"{'}'}\" или \"}\"?",
"Unexpected_token_expected_1179": "Неожиданный токен. Ожидался символ \"{\".",
"Unknown_build_option_0_5072": "Неизвестный параметр сборки \"{0}\".",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "Beklenmeyen belirteç.",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "Beklenmeyen belirteç. Bir oluşturucu, metot, erişimci veya özellik bekleniyordu.",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "Beklenmeyen belirteç. Küme ayracı olmadan bir tür parametresi adı bekleniyordu.",
"Unexpected_token_Did_you_mean_or_gt_1382": "Beklenmeyen belirteç. Şunu mu demek istediniz: `{'>'}` veya `>`?",
"Unexpected_token_Did_you_mean_or_gt_1382": "Beklenmeyen belirteç. Şunu mu demek istediniz: `{'>'}` veya `>`?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "Beklenmeyen belirteç. Şunu mu demek istediniz: `{'}'}` veya `}`?",
"Unexpected_token_expected_1179": "Beklenmeyen belirteç. '{' bekleniyordu.",
"Unknown_build_option_0_5072": "Bilinmeyen '{0}' derleme seçeneği.",
+154 -108
View File
@@ -6923,7 +6923,6 @@ var Diagnostics = {
Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
@@ -17042,7 +17041,8 @@ function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtens
}
function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
if (preference === "js" || resolutionMode === 99 /* ESNext */ && 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */) {
const moduleResolutionIsNodeNext = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */;
if (preference === "js" || resolutionMode === 99 /* ESNext */ && moduleResolutionIsNodeNext) {
if (!shouldAllowImportingTsExtension(compilerOptions)) {
return 2 /* JsExtension */;
}
@@ -17060,16 +17060,19 @@ function getModuleSpecifierEndingPreference(preference, resolutionMode, compiler
return inferPreference();
function inferPreference() {
let usesJsExtensions = false;
const specifiers = sourceFile.imports.length ? sourceFile.imports.map((i) => i.text) : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0].text) : emptyArray;
const specifiers = sourceFile.imports.length ? sourceFile.imports : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0]) : emptyArray;
for (const specifier of specifiers) {
if (pathIsRelative(specifier)) {
if (fileExtensionIsOneOf(specifier, extensionsNotSupportingExtensionlessResolution)) {
if (pathIsRelative(specifier.text)) {
if (moduleResolutionIsNodeNext && resolutionMode === 1 /* CommonJS */ && getModeForUsageLocation(sourceFile, specifier, compilerOptions) === 99 /* ESNext */) {
continue;
}
if (hasTSFileExtension(specifier)) {
if (fileExtensionIsOneOf(specifier.text, extensionsNotSupportingExtensionlessResolution)) {
continue;
}
if (hasTSFileExtension(specifier.text)) {
return 3 /* TsExtension */;
}
if (hasJSFileExtension(specifier)) {
if (hasJSFileExtension(specifier.text)) {
usesJsExtensions = true;
}
}
@@ -32493,7 +32496,7 @@ var Parser;
if (!jsDocDiagnostics) {
jsDocDiagnostics = [];
}
jsDocDiagnostics.push(...parseDiagnostics);
addRange(jsDocDiagnostics, parseDiagnostics, saveParseDiagnosticsLength);
}
currentToken = saveToken;
parseDiagnostics.length = saveParseDiagnosticsLength;
@@ -38721,15 +38724,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
}
}
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
const fromFile = tryFile(candidate2, onlyRecordFailures2, state2);
const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
if (fromFile) {
const resolved = resolvedIfExtensionMatches(extensions2, fromFile);
if (resolved) {
return noPackageId(resolved);
}
if (state2.traceEnabled) {
trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
}
return noPackageId(fromFile);
}
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
const features = state2.features;
@@ -38785,10 +38782,6 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
}
}
function resolvedIfExtensionMatches(extensions, path, resolvedUsingTsExtension) {
const ext = tryGetExtensionFromPath2(path);
return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : void 0;
}
function extensionIsOk(extensions, extension) {
return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
}
@@ -42636,11 +42629,12 @@ function createGetSymbolWalker(getRestTypeOfSignature, getTypePredicateOfSignatu
}
// src/compiler/moduleSpecifiers.ts
function getPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) {
const preferredEnding = getPreferredEnding();
function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) {
const filePreferredEnding = getPreferredEnding();
return {
relativePreference: oldImportSpecifier !== void 0 ? isExternalModuleNameRelative(oldImportSpecifier) ? 0 /* Relative */ : 1 /* NonRelative */ : importModuleSpecifierPreference === "relative" ? 0 /* Relative */ : importModuleSpecifierPreference === "non-relative" ? 1 /* NonRelative */ : importModuleSpecifierPreference === "project-relative" ? 3 /* ExternalNonRelative */ : 2 /* Shortest */,
getAllowedEndingsInPreferredOrder: (syntaxImpliedNodeFormat) => {
const preferredEnding = syntaxImpliedNodeFormat !== importingSourceFile.impliedNodeFormat ? getPreferredEnding(syntaxImpliedNodeFormat) : filePreferredEnding;
if ((syntaxImpliedNodeFormat ?? importingSourceFile.impliedNodeFormat) === 99 /* ESNext */) {
if (shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName)) {
return [3 /* TsExtension */, 2 /* JsExtension */];
@@ -42665,7 +42659,7 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
}
}
};
function getPreferredEnding() {
function getPreferredEnding(resolutionMode) {
if (oldImportSpecifier !== void 0) {
if (hasJSFileExtension(oldImportSpecifier))
return 2 /* JsExtension */;
@@ -42674,14 +42668,14 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
}
return getModuleSpecifierEndingPreference(
importModuleSpecifierEnding,
importingSourceFile.impliedNodeFormat,
resolutionMode ?? importingSourceFile.impliedNodeFormat,
compilerOptions,
importingSourceFile
);
}
}
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, options = {}) {
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getPreferences({}, compilerOptions, importingSourceFile), {}, options);
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile), {}, options);
}
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, preferences, userPreferences, options = {}) {
const info = getInfo(importingSourceFileName, host);
@@ -42753,7 +42747,7 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
}
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
const info = getInfo(importingSourceFile.fileName, host);
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
const preferences = getModuleSpecifierPreferences(userPreferences, compilerOptions, importingSourceFile);
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
(reason) => {
@@ -43263,7 +43257,7 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
if (!parts) {
return void 0;
}
const preferences = getPreferences(userPreferences, options, importingSourceFile);
const preferences = getModuleSpecifierPreferences(userPreferences, options, importingSourceFile);
const allowedEndings = preferences.getAllowedEndingsInPreferredOrder();
let moduleSpecifier = path;
let isPackageRootPath = false;
@@ -45915,6 +45909,11 @@ function createTypeChecker(host) {
diagnosticMessage = error(errorLocation, Diagnostics.Class_0_used_before_its_declaration, declarationName);
} else if (result.flags & 256 /* RegularEnum */) {
diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
} else {
Debug.assert(!!(result.flags & 128 /* ConstEnum */));
if (getIsolatedModules(compilerOptions)) {
diagnosticMessage = error(errorLocation, Diagnostics.Enum_0_used_before_its_declaration, declarationName);
}
}
if (diagnosticMessage) {
addRelatedInfo(diagnosticMessage, createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName));
@@ -54467,6 +54466,8 @@ function createTypeChecker(host) {
result.compositeSignatures = concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
if (paramMapper) {
result.mapper = left.compositeKind !== 2097152 /* Intersection */ && left.mapper && left.compositeSignatures ? combineTypeMappers(left.mapper, paramMapper) : paramMapper;
} else if (left.compositeKind !== 2097152 /* Intersection */ && left.mapper && left.compositeSignatures) {
result.mapper = left.mapper;
}
return result;
}
@@ -55064,7 +55065,7 @@ function createTypeChecker(host) {
return simplified !== type ? simplified : getConstraintOfType(type);
}
function getConstraintFromIndexedAccess(type) {
if (isMappedTypeGenericIndexedAccess(type) || isGenericMappedType(type.objectType)) {
if (isMappedTypeGenericIndexedAccess(type)) {
return substituteIndexedMappedType(type.objectType, type.indexType);
}
const indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
@@ -55314,11 +55315,15 @@ function createTypeChecker(host) {
return type.resolvedApparentType || (type.resolvedApparentType = getResolvedApparentTypeOfMappedType(type));
}
function getResolvedApparentTypeOfMappedType(type) {
const typeVariable = getHomomorphicTypeVariable(type);
if (typeVariable && !type.declaration.nameType) {
const constraint = getConstraintOfTypeParameter(typeVariable);
if (constraint && everyType(constraint, isArrayOrTupleType)) {
return instantiateType(type, prependTypeMapping(typeVariable, constraint, type.mapper));
const target = type.target ?? type;
const typeVariable = getHomomorphicTypeVariable(target);
if (typeVariable && !target.declaration.nameType) {
const constraint = getConstraintTypeFromMappedType(type);
if (constraint.flags & 4194304 /* Index */) {
const baseConstraint = getBaseConstraintOfType(constraint.type);
if (baseConstraint && everyType(baseConstraint, isArrayOrTupleType)) {
return instantiateType(target, prependTypeMapping(typeVariable, baseConstraint, type.mapper));
}
}
}
return type;
@@ -55577,10 +55582,14 @@ function createTypeChecker(host) {
return errorInfo;
}
function getPropertyOfType(type, name, skipObjectFunctionPropertyAugment, includeTypeOnlyMembers) {
var _a, _b;
type = getReducedApparentType(type);
if (type.flags & 524288 /* Object */) {
const resolved = resolveStructuredTypeMembers(type);
const symbol = resolved.members.get(name);
if (symbol && !includeTypeOnlyMembers && ((_a = type.symbol) == null ? void 0 : _a.flags) & 512 /* ValueModule */ && ((_b = getSymbolLinks(type.symbol).typeOnlyExportStarMap) == null ? void 0 : _b.has(name))) {
return void 0;
}
if (symbol && symbolIsValue(symbol, includeTypeOnlyMembers)) {
return symbol;
}
@@ -57353,7 +57362,7 @@ function createTypeChecker(host) {
return target.objectFlags & 8 /* Tuple */ ? createNormalizedTupleType(target, typeArguments) : createTypeReference(target, typeArguments);
}
function createNormalizedTupleType(target, elementTypes) {
var _a, _b, _c;
var _a, _b, _c, _d;
if (!(target.combinedFlags & 14 /* NonRequired */)) {
return createTypeReference(target, elementTypes);
}
@@ -57373,8 +57382,10 @@ function createTypeChecker(host) {
const type = elementTypes[i];
const flags = target.elementFlags[i];
if (flags & 8 /* Variadic */) {
if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
addElement(type, 8 /* Variadic */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
if (type.flags & 1 /* Any */) {
addElement(type, 4 /* Rest */, (_a = target.labeledElementDeclarations) == null ? void 0 : _a[i]);
} else if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
addElement(type, 8 /* Variadic */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
} else if (isTupleType(type)) {
const elements = getElementTypes(type);
if (elements.length + expandedTypes.length >= 1e4) {
@@ -57389,10 +57400,10 @@ function createTypeChecker(host) {
return addElement(t, type.target.elementFlags[n], (_a2 = type.target.labeledElementDeclarations) == null ? void 0 : _a2[n]);
});
} else {
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_b = target.labeledElementDeclarations) == null ? void 0 : _b[i]);
addElement(isArrayLikeType(type) && getIndexTypeOfType(type, numberType) || errorType, 4 /* Rest */, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
}
} else {
addElement(type, flags, (_c = target.labeledElementDeclarations) == null ? void 0 : _c[i]);
addElement(type, flags, (_d = target.labeledElementDeclarations) == null ? void 0 : _d[i]);
}
}
for (let i = 0; i < lastRequiredIndex; i++) {
@@ -58756,10 +58767,6 @@ function createTypeChecker(host) {
}
return type;
}
function maybeCloneTypeParameter(p) {
const constraint = getConstraintOfTypeParameter(p);
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
}
function isSimpleTupleType(node) {
return isTupleTypeNode(node) && length(node.elements) > 0 && !some(node.elements, (e) => isOptionalTypeNode(e) || isRestTypeNode(e) || isNamedTupleMember(e) && !!(e.questionToken || e.dotDotDotToken));
}
@@ -58789,27 +58796,19 @@ function createTypeChecker(host) {
const checkTypeDeferred = isDeferredType(checkType, checkTuples);
let combinedMapper;
if (root.inferTypeParameters) {
const freshParams = sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
const freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : void 0;
const context = createInferenceContext(
freshParams,
root.inferTypeParameters,
/*signature*/
void 0,
0 /* None */
);
if (freshMapper) {
const freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
for (let i = 0; i < freshParams.length; i++) {
if (freshParams[i] !== root.inferTypeParameters[i]) {
freshParams[i].mapper = freshCombinedMapper;
}
}
if (mapper) {
context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
}
if (!checkTypeDeferred) {
inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
}
const innerMapper = combineTypeMappers(freshMapper, context.mapper);
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
}
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
@@ -59786,8 +59785,8 @@ function createTypeChecker(host) {
if (!result) {
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
const checkType = root.checkType;
const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
const distributionType = root.isDistributive ? getReducedType(getMappedType(checkType, newMapper)) : void 0;
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(distributionType, (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper), forConstraint), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, forConstraint, aliasSymbol, aliasTypeArguments);
root.instantiations.set(id, result);
}
return result;
@@ -60661,8 +60660,8 @@ function createTypeChecker(host) {
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
for (let i = 0; i < paramCount; i++) {
const sourceType = i === restIndex ? getRestTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
const sourceType = i === restIndex ? getRestOrAnyTypeAtPosition(source, i) : tryGetTypeAtPosition(source, i);
const targetType = i === restIndex ? getRestOrAnyTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
if (sourceType && targetType) {
const sourceSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(source, i) ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
const targetSig = checkMode & 3 /* Callback */ || isInstantiatedGenericParameter(target, i) ? void 0 : getSingleCallSignature(getNonNullableType(targetType));
@@ -65645,7 +65644,7 @@ function createTypeChecker(host) {
function hasMatchingArgument(expression, reference) {
if (expression.arguments) {
for (const argument of expression.arguments) {
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) {
if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference) || getCandidateDiscriminantPropertyAccess(argument, reference)) {
return true;
}
}
@@ -65655,6 +65654,36 @@ function createTypeChecker(host) {
}
return false;
}
function getCandidateDiscriminantPropertyAccess(expr, reference) {
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
if (isIdentifier(expr)) {
const symbol = getResolvedSymbol(expr);
const declaration = symbol.valueDeclaration;
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
return declaration;
}
}
} else if (isAccessExpression(expr)) {
if (isMatchingReference(reference, expr.expression)) {
return expr;
}
} else if (isIdentifier(expr)) {
const symbol = getResolvedSymbol(expr);
if (isConstantVariable(symbol)) {
const declaration = symbol.valueDeclaration;
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
return declaration.initializer;
}
if (isBindingElement(declaration) && !declaration.initializer) {
const parent = declaration.parent.parent;
if (isVariableDeclaration(parent) && !parent.type && parent.initializer && (isIdentifier(parent.initializer) || isAccessExpression(parent.initializer)) && isMatchingReference(reference, parent.initializer)) {
return declaration;
}
}
}
}
return void 0;
}
function getFlowNodeId(flow) {
if (!flow.id || flow.id < 0) {
flow.id = nextFlowId;
@@ -66754,39 +66783,9 @@ function createTypeChecker(host) {
}
return result;
}
function getCandidateDiscriminantPropertyAccess(expr) {
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
if (isIdentifier(expr)) {
const symbol = getResolvedSymbol(expr);
const declaration = symbol.valueDeclaration;
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
return declaration;
}
}
} else if (isAccessExpression(expr)) {
if (isMatchingReference(reference, expr.expression)) {
return expr;
}
} else if (isIdentifier(expr)) {
const symbol = getResolvedSymbol(expr);
if (isConstantVariable(symbol)) {
const declaration = symbol.valueDeclaration;
if (isVariableDeclaration(declaration) && !declaration.type && declaration.initializer && isAccessExpression(declaration.initializer) && isMatchingReference(reference, declaration.initializer.expression)) {
return declaration.initializer;
}
if (isBindingElement(declaration) && !declaration.initializer) {
const parent = declaration.parent.parent;
if (isVariableDeclaration(parent) && !parent.type && parent.initializer && (isIdentifier(parent.initializer) || isAccessExpression(parent.initializer)) && isMatchingReference(reference, parent.initializer)) {
return declaration;
}
}
}
}
return void 0;
}
function getDiscriminantPropertyAccess(expr, computedType) {
if (declaredType.flags & 1048576 /* Union */ || computedType.flags & 1048576 /* Union */) {
const access = getCandidateDiscriminantPropertyAccess(expr);
const access = getCandidateDiscriminantPropertyAccess(expr, reference);
if (access) {
const name = getAccessedPropertyName(access);
if (name) {
@@ -73665,6 +73664,11 @@ function createTypeChecker(host) {
}
return createTupleType(types, flags, readonly, names);
}
function getRestOrAnyTypeAtPosition(source, pos) {
const restType = getRestTypeAtPosition(source, pos);
const elementType = restType && getElementTypeOfArrayType(restType);
return elementType && isTypeAny(elementType) ? anyType : restType;
}
function getParameterCount(signature) {
const length2 = signature.parameters.length;
if (signatureHasRestParameter(signature)) {
@@ -73721,7 +73725,7 @@ function createTypeChecker(host) {
if (signatureHasRestParameter(signature)) {
const restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
if (!isTupleType(restType)) {
return restType;
return isTypeAny(restType) ? anyArrayType : restType;
}
if (restType.target.hasRestElement) {
return sliceTupleType(restType, restType.target.fixedLength);
@@ -77025,20 +77029,17 @@ function createTypeChecker(host) {
const objectType = type.objectType;
const indexType = type.indexType;
const objectIndexType = isGenericMappedType(objectType) && getMappedTypeNameTypeKind(objectType) === 2 /* Remapping */ ? getIndexTypeForMappedType(objectType, 0 /* None */) : getIndexType(objectType, 0 /* None */);
if (isTypeAssignableTo(indexType, objectIndexType)) {
const hasNumberIndexInfo = !!getIndexInfoOfType(objectType, numberType);
if (everyType(indexType, (t) => isTypeAssignableTo(t, objectIndexType) || hasNumberIndexInfo && isApplicableIndexType(t, numberType))) {
if (accessNode.kind === 212 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
}
return type;
}
const apparentObjectType = getApparentType(objectType);
if (getIndexInfoOfType(apparentObjectType, numberType) && isTypeAssignableToKind(indexType, 296 /* NumberLike */)) {
return type;
}
if (isGenericObjectType(objectType)) {
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
if (propertyName) {
const propertySymbol = forEachType(apparentObjectType, (t) => getPropertyOfType(t, propertyName));
const propertySymbol = forEachType(getApparentType(objectType), (t) => getPropertyOfType(t, propertyName));
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
error(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
return errorType;
@@ -83098,7 +83099,7 @@ function createTypeChecker(host) {
true,
location
);
const resolvedSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
const resolvedValueSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */)));
const typeSymbol = resolveEntityName(
typeName,
@@ -83106,26 +83107,30 @@ function createTypeChecker(host) {
/*ignoreErrors*/
true,
/*dontResolveAlias*/
false,
true,
location
);
if (resolvedSymbol && resolvedSymbol === typeSymbol) {
const resolvedTypeSymbol = typeSymbol && typeSymbol.flags & 2097152 /* Alias */ ? resolveAlias(typeSymbol) : typeSymbol;
if (!valueSymbol) {
isTypeOnly || (isTypeOnly = !!(typeSymbol && getTypeOnlyAliasDeclaration(typeSymbol, 788968 /* Type */)));
}
if (resolvedValueSymbol && resolvedValueSymbol === resolvedTypeSymbol) {
const globalPromiseSymbol = getGlobalPromiseConstructorSymbol(
/*reportErrors*/
false
);
if (globalPromiseSymbol && resolvedSymbol === globalPromiseSymbol) {
if (globalPromiseSymbol && resolvedValueSymbol === globalPromiseSymbol) {
return 9 /* Promise */;
}
const constructorType = getTypeOfSymbol(resolvedSymbol);
const constructorType = getTypeOfSymbol(resolvedValueSymbol);
if (constructorType && isConstructorType(constructorType)) {
return isTypeOnly ? 10 /* TypeWithCallSignature */ : 1 /* TypeWithConstructSignatureAndValue */;
}
}
if (!typeSymbol) {
if (!resolvedTypeSymbol) {
return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
}
const type = getDeclaredTypeOfSymbol(typeSymbol);
const type = getDeclaredTypeOfSymbol(resolvedTypeSymbol);
if (isErrorType(type)) {
return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
} else if (type.flags & 3 /* AnyOrUnknown */) {
@@ -88595,9 +88600,50 @@ function transformTypeScript(context) {
return visitorWorker(node);
}
}
function visitElidableStatement(node) {
function isElisionBlocked(node) {
const parsed = getParseTreeNode(node);
if (parsed !== node) {
if (parsed === node || isExportAssignment(node)) {
return false;
}
if (!parsed || parsed.kind !== node.kind) {
return true;
}
switch (node.kind) {
case 272 /* ImportDeclaration */:
Debug.assertNode(parsed, isImportDeclaration);
if (node.importClause !== parsed.importClause) {
return true;
}
if (node.attributes !== parsed.attributes) {
return true;
}
break;
case 271 /* ImportEqualsDeclaration */:
Debug.assertNode(parsed, isImportEqualsDeclaration);
if (node.name !== parsed.name) {
return true;
}
if (node.isTypeOnly !== parsed.isTypeOnly) {
return true;
}
if (node.moduleReference !== parsed.moduleReference && (isEntityName(node.moduleReference) || isEntityName(parsed.moduleReference))) {
return true;
}
break;
case 278 /* ExportDeclaration */:
Debug.assertNode(parsed, isExportDeclaration);
if (node.exportClause !== parsed.exportClause) {
return true;
}
if (node.attributes !== parsed.attributes) {
return true;
}
break;
}
return false;
}
function visitElidableStatement(node) {
if (isElisionBlocked(node)) {
if (node.transformFlags & 1 /* ContainsTypeScript */) {
return visitEachChild(node, visitor, context);
}
@@ -115236,7 +115282,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
}
}
const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target === 99 /* ESNext */ ? 8 /* AllowNumericSeparator */ : 0);
const flags = (neverAsciiEscape ? 1 /* NeverAsciiEscape */ : 0) | (jsxAttributeEscape ? 2 /* JsxAttributeEscape */ : 0) | (printerOptions.terminateUnterminatedLiterals ? 4 /* TerminateUnterminatedLiterals */ : 0) | (printerOptions.target && printerOptions.target >= 8 /* ES2021 */ ? 8 /* AllowNumericSeparator */ : 0);
return getLiteralText(node, currentSourceFile, flags);
}
function pushNameGenerationScope(node) {
+486 -347
View File
File diff suppressed because it is too large Load Diff
+1 -12
View File
@@ -3332,18 +3332,6 @@ declare namespace ts {
* Last version that was reported.
*/
private lastReportedVersion;
/**
* Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
* This property is changed in 'updateGraph' based on the set of files in program
*/
private projectProgramVersion;
/**
* Current version of the project state. It is changed when:
* - new root file was added/removed
* - edit happen in some file that is currently included in the project.
* This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
*/
private projectStateVersion;
protected projectErrors: Diagnostic[] | undefined;
protected isInitialLoadPending: () => boolean;
private readonly cancellationToken;
@@ -3918,6 +3906,7 @@ declare namespace ts {
private static escapeFilenameForRegex;
resetSafeList(): void;
applySafeList(proj: protocol.ExternalProject): NormalizedPath[];
private applySafeListWorker;
openExternalProject(proj: protocol.ExternalProject): void;
hasDeferredExtension(): boolean;
private enableRequestedPluginsAsync;
+488 -347
View File
File diff suppressed because it is too large Load Diff
+3 -14
View File
@@ -6299,7 +6299,6 @@ var Diagnostics = {
Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
@@ -24327,7 +24326,7 @@ var Parser;
if (!jsDocDiagnostics) {
jsDocDiagnostics = [];
}
jsDocDiagnostics.push(...parseDiagnostics);
addRange(jsDocDiagnostics, parseDiagnostics, saveParseDiagnosticsLength);
}
currentToken = saveToken;
parseDiagnostics.length = saveParseDiagnosticsLength;
@@ -28567,15 +28566,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
}
}
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
const fromFile = tryFile(candidate2, onlyRecordFailures2, state2);
const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
if (fromFile) {
const resolved = resolvedIfExtensionMatches(extensions2, fromFile);
if (resolved) {
return noPackageId(resolved);
}
if (state2.traceEnabled) {
trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
}
return noPackageId(fromFile);
}
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
const features = state2.features;
@@ -28631,10 +28624,6 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
}
}
function resolvedIfExtensionMatches(extensions, path2, resolvedUsingTsExtension) {
const ext = tryGetExtensionFromPath2(path2);
return ext !== void 0 && extensionIsOk(extensions, ext) ? { path: path2, ext, resolvedUsingTsExtension } : void 0;
}
function extensionIsOk(extensions, extension) {
return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
}
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "意外的标记。",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "意外的标记。应为构造函数、方法、访问器或属性。",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "意外的标记。类型参数名不应包含大括号。",
"Unexpected_token_Did_you_mean_or_gt_1382": "意外的标记。你是想使用 `{'>'}` 还是 `>`?",
"Unexpected_token_Did_you_mean_or_gt_1382": "意外的标记。你是想使用 `{'>'}` 还是 `&gt;`?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "意外的标记。你是想使用 `{'}'}` 还是 `&rbrace;`?",
"Unexpected_token_expected_1179": "意外标记。应为 \"{\"。",
"Unknown_build_option_0_5072": "未知的生成选项 \"{0}\"。",
+1 -1
View File
@@ -1628,7 +1628,7 @@
"Unexpected_token_1012": "未預期的語彙基元。",
"Unexpected_token_A_constructor_method_accessor_or_property_was_expected_1068": "未預期的語彙基元。必須是建構函式、方法、存取子或屬性。",
"Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces_1069": "權杖錯誤。類型參數名稱不應有大括號。",
"Unexpected_token_Did_you_mean_or_gt_1382": "未預期的語彙基元。您是指 `{'>'}` 或 `>` 嗎?",
"Unexpected_token_Did_you_mean_or_gt_1382": "未預期的語彙基元。您是指 `{'>'}` 或 `&gt;` 嗎?",
"Unexpected_token_Did_you_mean_or_rbrace_1381": "未預期的語彙基元。您是指 `{'}'}` 或 `&rbrace;` 嗎?",
"Unexpected_token_expected_1179": "未預期的語彙基元。必須是 '{'。",
"Unknown_build_option_0_5072": "未知的組建選項 '{0}'。",