@typescript-deploys/pr-build 4.6.0-pr-47126-8 → 4.6.0-pr-47400-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +249 -157
- package/lib/tsserver.js +515 -335
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +515 -335
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +461 -314
- package/lib/typescriptServices.d.ts +1 -1
- package/lib/typescriptServices.js +461 -314
- package/lib/typingsInstaller.js +400 -262
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220113";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -1855,14 +1855,6 @@ var ts;
|
|
|
1855
1855
|
}
|
|
1856
1856
|
return s.slice(0, end + 1);
|
|
1857
1857
|
}
|
|
1858
|
-
function startWhitespaceCount(s) {
|
|
1859
|
-
for (var i = 0; i < s.length; i++) {
|
|
1860
|
-
if (!ts.isWhiteSpaceLike(s.charCodeAt(i)))
|
|
1861
|
-
return i;
|
|
1862
|
-
}
|
|
1863
|
-
return s.length;
|
|
1864
|
-
}
|
|
1865
|
-
ts.startWhitespaceCount = startWhitespaceCount;
|
|
1866
1858
|
})(ts || (ts = {}));
|
|
1867
1859
|
var ts;
|
|
1868
1860
|
(function (ts) {
|
|
@@ -5814,12 +5806,12 @@ var ts;
|
|
|
5814
5806
|
Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
|
|
5815
5807
|
Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
|
|
5816
5808
|
Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"),
|
|
5817
|
-
|
|
5809
|
+
_0_is_declared_here: diag(2728, ts.DiagnosticCategory.Message, "_0_is_declared_here_2728", "'{0}' is declared here."),
|
|
5818
5810
|
Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."),
|
|
5819
5811
|
An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."),
|
|
5820
5812
|
Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),
|
|
5821
5813
|
Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),
|
|
5822
|
-
|
|
5814
|
+
Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."),
|
|
5823
5815
|
Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"),
|
|
5824
5816
|
Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),
|
|
5825
5817
|
Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."),
|
|
@@ -6250,7 +6242,7 @@ var ts;
|
|
|
6250
6242
|
Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, ts.DiagnosticCategory.Error, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"),
|
|
6251
6243
|
Conflicts_are_in_this_file: diag(6201, ts.DiagnosticCategory.Message, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."),
|
|
6252
6244
|
Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
|
|
6253
|
-
|
|
6245
|
+
_0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."),
|
|
6254
6246
|
and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."),
|
|
6255
6247
|
All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."),
|
|
6256
6248
|
package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."),
|
|
@@ -15687,16 +15679,6 @@ var ts;
|
|
|
15687
15679
|
(symlinkedDirectories || (symlinkedDirectories = new ts.Map())).set(symlinkPath, real);
|
|
15688
15680
|
}
|
|
15689
15681
|
},
|
|
15690
|
-
setSymlinkedDirectoryFromSymlinkedFile: function (symlink, real) {
|
|
15691
|
-
this.setSymlinkedFile(ts.toPath(symlink, cwd, getCanonicalFileName), real);
|
|
15692
|
-
var _a = guessDirectorySymlink(real, symlink, cwd, getCanonicalFileName) || ts.emptyArray, commonResolved = _a[0], commonOriginal = _a[1];
|
|
15693
|
-
if (commonResolved && commonOriginal) {
|
|
15694
|
-
this.setSymlinkedDirectory(commonOriginal, {
|
|
15695
|
-
real: commonResolved,
|
|
15696
|
-
realPath: ts.toPath(commonResolved, cwd, getCanonicalFileName),
|
|
15697
|
-
});
|
|
15698
|
-
}
|
|
15699
|
-
},
|
|
15700
15682
|
setSymlinksFromResolutions: function (files, typeReferenceDirectives) {
|
|
15701
15683
|
var _this = this;
|
|
15702
15684
|
var _a;
|
|
@@ -16534,9 +16516,19 @@ var ts;
|
|
|
16534
16516
|
}
|
|
16535
16517
|
ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
|
|
16536
16518
|
function escapeSnippetText(text) {
|
|
16537
|
-
return text.replace(/\$/gm, "\\$");
|
|
16519
|
+
return text.replace(/\$/gm, function () { return "\\$"; });
|
|
16538
16520
|
}
|
|
16539
16521
|
ts.escapeSnippetText = escapeSnippetText;
|
|
16522
|
+
function isNumericLiteralName(name) {
|
|
16523
|
+
return (+name).toString() === name;
|
|
16524
|
+
}
|
|
16525
|
+
ts.isNumericLiteralName = isNumericLiteralName;
|
|
16526
|
+
function createPropertyNameNodeForIdentifierOrLiteral(name, target, singleQuote, stringNamed) {
|
|
16527
|
+
return ts.isIdentifierText(name, target) ? ts.factory.createIdentifier(name) :
|
|
16528
|
+
!stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
|
|
16529
|
+
ts.factory.createStringLiteral(name, !!singleQuote);
|
|
16530
|
+
}
|
|
16531
|
+
ts.createPropertyNameNodeForIdentifierOrLiteral = createPropertyNameNodeForIdentifierOrLiteral;
|
|
16540
16532
|
function isThisTypeParameter(type) {
|
|
16541
16533
|
return !!(type.flags & 262144 && type.isThisType);
|
|
16542
16534
|
}
|
|
@@ -33844,9 +33836,7 @@ var ts;
|
|
|
33844
33836
|
}
|
|
33845
33837
|
}
|
|
33846
33838
|
var failedLookupLocations = [];
|
|
33847
|
-
var features =
|
|
33848
|
-
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
33849
|
-
NodeResolutionFeatures.None;
|
|
33839
|
+
var features = getDefaultNodeResolutionFeatures(options);
|
|
33850
33840
|
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
33851
33841
|
var resolved = primaryLookup();
|
|
33852
33842
|
var primary = true;
|
|
@@ -33929,6 +33919,30 @@ var ts;
|
|
|
33929
33919
|
}
|
|
33930
33920
|
}
|
|
33931
33921
|
ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
|
|
33922
|
+
function getDefaultNodeResolutionFeatures(options) {
|
|
33923
|
+
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
|
|
33924
|
+
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
33925
|
+
NodeResolutionFeatures.None;
|
|
33926
|
+
}
|
|
33927
|
+
function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) {
|
|
33928
|
+
var moduleResolutionState = {
|
|
33929
|
+
compilerOptions: options,
|
|
33930
|
+
host: host,
|
|
33931
|
+
traceEnabled: isTraceEnabled(options, host),
|
|
33932
|
+
failedLookupLocations: [],
|
|
33933
|
+
packageJsonInfoCache: cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(),
|
|
33934
|
+
conditions: ts.emptyArray,
|
|
33935
|
+
features: NodeResolutionFeatures.None,
|
|
33936
|
+
};
|
|
33937
|
+
return ts.forEachAncestorDirectory(containingDirectory, function (ancestorDirectory) {
|
|
33938
|
+
if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
33939
|
+
var nodeModulesFolder = ts.combinePaths(ancestorDirectory, "node_modules");
|
|
33940
|
+
var candidate = ts.combinePaths(nodeModulesFolder, packageName);
|
|
33941
|
+
return getPackageJsonInfo(candidate, false, moduleResolutionState);
|
|
33942
|
+
}
|
|
33943
|
+
});
|
|
33944
|
+
}
|
|
33945
|
+
ts.resolvePackageNameToPackageJson = resolvePackageNameToPackageJson;
|
|
33932
33946
|
function getAutomaticTypeDirectiveNames(options, host) {
|
|
33933
33947
|
if (options.types) {
|
|
33934
33948
|
return options.types;
|
|
@@ -34388,10 +34402,6 @@ var ts;
|
|
|
34388
34402
|
return resolvedModule.resolvedFileName;
|
|
34389
34403
|
}
|
|
34390
34404
|
ts.resolveJSModule = resolveJSModule;
|
|
34391
|
-
function tryResolveJSModule(moduleName, initialDir, host) {
|
|
34392
|
-
return tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;
|
|
34393
|
-
}
|
|
34394
|
-
ts.tryResolveJSModule = tryResolveJSModule;
|
|
34395
34405
|
var NodeResolutionFeatures;
|
|
34396
34406
|
(function (NodeResolutionFeatures) {
|
|
34397
34407
|
NodeResolutionFeatures[NodeResolutionFeatures["None"] = 0] = "None";
|
|
@@ -34665,6 +34675,91 @@ var ts;
|
|
|
34665
34675
|
var versionPaths = packageInfo && packageInfo.versionPaths;
|
|
34666
34676
|
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
34667
34677
|
}
|
|
34678
|
+
function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
|
|
34679
|
+
if (!resolveJs && packageJsonInfo.resolvedEntrypoints !== undefined) {
|
|
34680
|
+
return packageJsonInfo.resolvedEntrypoints;
|
|
34681
|
+
}
|
|
34682
|
+
var entrypoints;
|
|
34683
|
+
var extensions = resolveJs ? Extensions.JavaScript : Extensions.TypeScript;
|
|
34684
|
+
var features = getDefaultNodeResolutionFeatures(options);
|
|
34685
|
+
var requireState = {
|
|
34686
|
+
compilerOptions: options,
|
|
34687
|
+
host: host,
|
|
34688
|
+
traceEnabled: isTraceEnabled(options, host),
|
|
34689
|
+
failedLookupLocations: [],
|
|
34690
|
+
packageJsonInfoCache: cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(),
|
|
34691
|
+
conditions: ["node", "require", "types"],
|
|
34692
|
+
features: features,
|
|
34693
|
+
};
|
|
34694
|
+
var requireResolution = loadNodeModuleFromDirectoryWorker(extensions, packageJsonInfo.packageDirectory, false, requireState, packageJsonInfo.packageJsonContent, packageJsonInfo.versionPaths);
|
|
34695
|
+
entrypoints = ts.append(entrypoints, requireResolution === null || requireResolution === void 0 ? void 0 : requireResolution.path);
|
|
34696
|
+
if (features & NodeResolutionFeatures.Exports && packageJsonInfo.packageJsonContent.exports) {
|
|
34697
|
+
for (var _i = 0, _a = [["node", "import", "types"], ["node", "require", "types"]]; _i < _a.length; _i++) {
|
|
34698
|
+
var conditions = _a[_i];
|
|
34699
|
+
var exportState = __assign(__assign({}, requireState), { failedLookupLocations: [], conditions: conditions });
|
|
34700
|
+
var exportResolutions = loadEntrypointsFromExportMap(packageJsonInfo, packageJsonInfo.packageJsonContent.exports, exportState, extensions);
|
|
34701
|
+
if (exportResolutions) {
|
|
34702
|
+
for (var _b = 0, exportResolutions_1 = exportResolutions; _b < exportResolutions_1.length; _b++) {
|
|
34703
|
+
var resolution = exportResolutions_1[_b];
|
|
34704
|
+
entrypoints = ts.appendIfUnique(entrypoints, resolution.path);
|
|
34705
|
+
}
|
|
34706
|
+
}
|
|
34707
|
+
}
|
|
34708
|
+
}
|
|
34709
|
+
return packageJsonInfo.resolvedEntrypoints = entrypoints || false;
|
|
34710
|
+
}
|
|
34711
|
+
ts.getEntrypointsFromPackageJsonInfo = getEntrypointsFromPackageJsonInfo;
|
|
34712
|
+
function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
34713
|
+
var entrypoints;
|
|
34714
|
+
if (ts.isArray(exports)) {
|
|
34715
|
+
for (var _i = 0, exports_1 = exports; _i < exports_1.length; _i++) {
|
|
34716
|
+
var target = exports_1[_i];
|
|
34717
|
+
loadEntrypointsFromTargetExports(target);
|
|
34718
|
+
}
|
|
34719
|
+
}
|
|
34720
|
+
else if (typeof exports === "object" && exports !== null && allKeysStartWithDot(exports)) {
|
|
34721
|
+
for (var key in exports) {
|
|
34722
|
+
loadEntrypointsFromTargetExports(exports[key]);
|
|
34723
|
+
}
|
|
34724
|
+
}
|
|
34725
|
+
else {
|
|
34726
|
+
loadEntrypointsFromTargetExports(exports);
|
|
34727
|
+
}
|
|
34728
|
+
return entrypoints;
|
|
34729
|
+
function loadEntrypointsFromTargetExports(target) {
|
|
34730
|
+
var _a, _b;
|
|
34731
|
+
if (typeof target === "string" && ts.startsWith(target, "./") && target.indexOf("*") === -1) {
|
|
34732
|
+
var partsAfterFirst = ts.getPathComponents(target).slice(2);
|
|
34733
|
+
if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
|
|
34734
|
+
return false;
|
|
34735
|
+
}
|
|
34736
|
+
var resolvedTarget = ts.combinePaths(scope.packageDirectory, target);
|
|
34737
|
+
var finalPath = ts.getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
34738
|
+
var result = loadJSOrExactTSFileName(extensions, finalPath, false, state);
|
|
34739
|
+
if (result) {
|
|
34740
|
+
entrypoints = ts.appendIfUnique(entrypoints, result, function (a, b) { return a.path === b.path; });
|
|
34741
|
+
return true;
|
|
34742
|
+
}
|
|
34743
|
+
}
|
|
34744
|
+
else if (Array.isArray(target)) {
|
|
34745
|
+
for (var _i = 0, target_1 = target; _i < target_1.length; _i++) {
|
|
34746
|
+
var t = target_1[_i];
|
|
34747
|
+
var success = loadEntrypointsFromTargetExports(t);
|
|
34748
|
+
if (success) {
|
|
34749
|
+
return true;
|
|
34750
|
+
}
|
|
34751
|
+
}
|
|
34752
|
+
}
|
|
34753
|
+
else if (typeof target === "object" && target !== null) {
|
|
34754
|
+
return ts.forEach(ts.getOwnKeys(target), function (key) {
|
|
34755
|
+
if (key === "default" || ts.contains(state.conditions, key) || isApplicableVersionedTypesKey(state.conditions, key)) {
|
|
34756
|
+
loadEntrypointsFromTargetExports(target[key]);
|
|
34757
|
+
return true;
|
|
34758
|
+
}
|
|
34759
|
+
});
|
|
34760
|
+
}
|
|
34761
|
+
}
|
|
34762
|
+
}
|
|
34668
34763
|
function getPackageScopeForPath(fileName, packageJsonInfoCache, host, options) {
|
|
34669
34764
|
var state = {
|
|
34670
34765
|
host: host,
|
|
@@ -34716,7 +34811,7 @@ var ts;
|
|
|
34716
34811
|
trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
34717
34812
|
}
|
|
34718
34813
|
var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);
|
|
34719
|
-
var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths };
|
|
34814
|
+
var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths, resolvedEntrypoints: undefined };
|
|
34720
34815
|
(_b = state.packageJsonInfoCache) === null || _b === void 0 ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result);
|
|
34721
34816
|
return result;
|
|
34722
34817
|
}
|
|
@@ -34998,8 +35093,8 @@ var ts;
|
|
|
34998
35093
|
}
|
|
34999
35094
|
return toSearchResult(undefined);
|
|
35000
35095
|
}
|
|
35001
|
-
for (var _d = 0,
|
|
35002
|
-
var elem =
|
|
35096
|
+
for (var _d = 0, target_2 = target; _d < target_2.length; _d++) {
|
|
35097
|
+
var elem = target_2[_d];
|
|
35003
35098
|
var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
|
|
35004
35099
|
if (result) {
|
|
35005
35100
|
return result;
|
|
@@ -38308,6 +38403,7 @@ var ts;
|
|
|
38308
38403
|
var location = ts.getParseTreeNode(locationIn);
|
|
38309
38404
|
return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;
|
|
38310
38405
|
},
|
|
38406
|
+
getTypeOfSymbol: getTypeOfSymbol,
|
|
38311
38407
|
getSymbolsOfParameterPropertyDeclaration: function (parameterIn, parameterName) {
|
|
38312
38408
|
var parameter = ts.getParseTreeNode(parameterIn, ts.isParameter);
|
|
38313
38409
|
if (parameter === undefined)
|
|
@@ -39153,7 +39249,7 @@ var ts;
|
|
|
39153
39249
|
if (adjustedNode === errorNode)
|
|
39154
39250
|
return "continue";
|
|
39155
39251
|
err.relatedInformation = err.relatedInformation || [];
|
|
39156
|
-
var leadingMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics.
|
|
39252
|
+
var leadingMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics._0_was_also_declared_here, symbolName);
|
|
39157
39253
|
var followOnMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics.and_here);
|
|
39158
39254
|
if (ts.length(err.relatedInformation) >= 5 || ts.some(err.relatedInformation, function (r) { return ts.compareDiagnostics(r, followOnMessage) === 0 || ts.compareDiagnostics(r, leadingMessage) === 0; }))
|
|
39159
39255
|
return "continue";
|
|
@@ -39747,7 +39843,7 @@ var ts;
|
|
|
39747
39843
|
var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
|
|
39748
39844
|
addErrorOrSuggestion(!isUncheckedJS, diagnostic);
|
|
39749
39845
|
if (suggestion.valueDeclaration) {
|
|
39750
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics.
|
|
39846
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
39751
39847
|
}
|
|
39752
39848
|
}
|
|
39753
39849
|
}
|
|
@@ -40044,7 +40140,7 @@ var ts;
|
|
|
40044
40140
|
}
|
|
40045
40141
|
}
|
|
40046
40142
|
if (diagnosticMessage) {
|
|
40047
|
-
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics.
|
|
40143
|
+
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_is_declared_here, declarationName));
|
|
40048
40144
|
}
|
|
40049
40145
|
}
|
|
40050
40146
|
}
|
|
@@ -40316,7 +40412,7 @@ var ts;
|
|
|
40316
40412
|
var suggestionName = symbolToString(suggestion);
|
|
40317
40413
|
var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
|
|
40318
40414
|
if (suggestion.valueDeclaration) {
|
|
40319
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics.
|
|
40415
|
+
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
|
|
40320
40416
|
}
|
|
40321
40417
|
}
|
|
40322
40418
|
else {
|
|
@@ -40348,7 +40444,7 @@ var ts;
|
|
|
40348
40444
|
error(name, ts.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
|
|
40349
40445
|
if (localSymbol.declarations) {
|
|
40350
40446
|
ts.addRelatedInfo.apply(void 0, __spreadArray([diagnostic], ts.map(localSymbol.declarations, function (decl, index) {
|
|
40351
|
-
return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics.
|
|
40447
|
+
return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics._0_is_declared_here : ts.Diagnostics.and_here, declarationName);
|
|
40352
40448
|
}), false));
|
|
40353
40449
|
}
|
|
40354
40450
|
}
|
|
@@ -40942,7 +41038,7 @@ var ts;
|
|
|
40942
41038
|
if (!sigs || !sigs.length) {
|
|
40943
41039
|
sigs = getSignaturesOfStructuredType(type, 1);
|
|
40944
41040
|
}
|
|
40945
|
-
if ((sigs && sigs.length) || getPropertyOfType(type, "default")) {
|
|
41041
|
+
if ((sigs && sigs.length) || getPropertyOfType(type, "default", true)) {
|
|
40946
41042
|
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
40947
41043
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
40948
41044
|
}
|
|
@@ -42946,8 +43042,8 @@ var ts;
|
|
|
42946
43042
|
}
|
|
42947
43043
|
else {
|
|
42948
43044
|
if (parent && getExportsOfSymbol(parent)) {
|
|
42949
|
-
var
|
|
42950
|
-
ts.forEachEntry(
|
|
43045
|
+
var exports_2 = getExportsOfSymbol(parent);
|
|
43046
|
+
ts.forEachEntry(exports_2, function (ex, name) {
|
|
42951
43047
|
if (getSymbolIfSameReference(ex, symbol) && !isLateBoundName(name) && name !== "export=") {
|
|
42952
43048
|
symbolName = ts.unescapeLeadingUnderscores(name);
|
|
42953
43049
|
return true;
|
|
@@ -43105,31 +43201,26 @@ var ts;
|
|
|
43105
43201
|
}
|
|
43106
43202
|
var rawName = ts.unescapeLeadingUnderscores(symbol.escapedName);
|
|
43107
43203
|
var stringNamed = !!ts.length(symbol.declarations) && ts.every(symbol.declarations, isStringNamed);
|
|
43108
|
-
return createPropertyNameNodeForIdentifierOrLiteral(rawName,
|
|
43204
|
+
return ts.createPropertyNameNodeForIdentifierOrLiteral(rawName, ts.getEmitScriptTarget(compilerOptions), singleQuote, stringNamed);
|
|
43109
43205
|
}
|
|
43110
43206
|
function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote) {
|
|
43111
43207
|
var nameType = getSymbolLinks(symbol).nameType;
|
|
43112
43208
|
if (nameType) {
|
|
43113
43209
|
if (nameType.flags & 384) {
|
|
43114
43210
|
var name = "" + nameType.value;
|
|
43115
|
-
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
43211
|
+
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
43116
43212
|
return ts.factory.createStringLiteral(name, !!singleQuote);
|
|
43117
43213
|
}
|
|
43118
|
-
if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
43214
|
+
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
43119
43215
|
return ts.factory.createComputedPropertyName(ts.factory.createNumericLiteral(+name));
|
|
43120
43216
|
}
|
|
43121
|
-
return createPropertyNameNodeForIdentifierOrLiteral(name);
|
|
43217
|
+
return ts.createPropertyNameNodeForIdentifierOrLiteral(name, ts.getEmitScriptTarget(compilerOptions));
|
|
43122
43218
|
}
|
|
43123
43219
|
if (nameType.flags & 8192) {
|
|
43124
43220
|
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551));
|
|
43125
43221
|
}
|
|
43126
43222
|
}
|
|
43127
43223
|
}
|
|
43128
|
-
function createPropertyNameNodeForIdentifierOrLiteral(name, stringNamed, singleQuote) {
|
|
43129
|
-
return ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) ? ts.factory.createIdentifier(name) :
|
|
43130
|
-
!stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
|
|
43131
|
-
ts.factory.createStringLiteral(name, !!singleQuote);
|
|
43132
|
-
}
|
|
43133
43224
|
function cloneNodeBuilderContext(context) {
|
|
43134
43225
|
var initial = __assign({}, context);
|
|
43135
43226
|
if (initial.typeParameterNames) {
|
|
@@ -44325,10 +44416,10 @@ var ts;
|
|
|
44325
44416
|
if (nameType) {
|
|
44326
44417
|
if (nameType.flags & 384) {
|
|
44327
44418
|
var name = "" + nameType.value;
|
|
44328
|
-
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
44419
|
+
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
44329
44420
|
return "\"" + ts.escapeString(name, 34) + "\"";
|
|
44330
44421
|
}
|
|
44331
|
-
if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
44422
|
+
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
44332
44423
|
return "[" + name + "]";
|
|
44333
44424
|
}
|
|
44334
44425
|
return name;
|
|
@@ -45119,8 +45210,8 @@ var ts;
|
|
|
45119
45210
|
if (s.valueDeclaration && exportedMember.valueDeclaration && ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {
|
|
45120
45211
|
var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);
|
|
45121
45212
|
var exportedMemberName = ((_a = ts.tryCast(exportedMember.valueDeclaration, ts.isNamedDeclaration)) === null || _a === void 0 ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
45122
|
-
ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics.
|
|
45123
|
-
ts.addRelatedInfo(error(exportedMemberName, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(s.valueDeclaration, ts.Diagnostics.
|
|
45213
|
+
ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here, unescapedName));
|
|
45214
|
+
ts.addRelatedInfo(error(exportedMemberName, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(s.valueDeclaration, ts.Diagnostics._0_was_also_declared_here, unescapedName));
|
|
45124
45215
|
}
|
|
45125
45216
|
var union = createSymbol(s.flags | exportedMember.flags, name);
|
|
45126
45217
|
union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
|
|
@@ -46370,7 +46461,7 @@ var ts;
|
|
|
46370
46461
|
if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
|
|
46371
46462
|
var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
46372
46463
|
var name_4 = !(type.flags & 8192) && ts.unescapeLeadingUnderscores(memberName) || ts.declarationNameToString(declName);
|
|
46373
|
-
ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.
|
|
46464
|
+
ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here, name_4); });
|
|
46374
46465
|
error(declName || decl, ts.Diagnostics.Duplicate_property_0, name_4);
|
|
46375
46466
|
lateSymbol = createSymbol(0, memberName, 4096);
|
|
46376
46467
|
}
|
|
@@ -47303,6 +47394,9 @@ var ts;
|
|
|
47303
47394
|
return simplified !== type ? simplified : getConstraintOfType(type);
|
|
47304
47395
|
}
|
|
47305
47396
|
function getConstraintFromIndexedAccess(type) {
|
|
47397
|
+
if (isMappedTypeGenericIndexedAccess(type)) {
|
|
47398
|
+
return substituteIndexedMappedType(type.objectType, type.indexType);
|
|
47399
|
+
}
|
|
47306
47400
|
var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
|
|
47307
47401
|
if (indexConstraint && indexConstraint !== type.indexType) {
|
|
47308
47402
|
var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.accessFlags);
|
|
@@ -47471,6 +47565,9 @@ var ts;
|
|
|
47471
47565
|
return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
47472
47566
|
}
|
|
47473
47567
|
if (t.flags & 8388608) {
|
|
47568
|
+
if (isMappedTypeGenericIndexedAccess(t)) {
|
|
47569
|
+
return getBaseConstraint(substituteIndexedMappedType(t.objectType, t.indexType));
|
|
47570
|
+
}
|
|
47474
47571
|
var baseObjectType = getBaseConstraint(t.objectType);
|
|
47475
47572
|
var baseIndexType = getBaseConstraint(t.indexType);
|
|
47476
47573
|
var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.accessFlags);
|
|
@@ -47537,9 +47634,7 @@ var ts;
|
|
|
47537
47634
|
!isGenericMappedType(type.objectType) && isGenericIndexType(type.indexType);
|
|
47538
47635
|
}
|
|
47539
47636
|
function getApparentType(type) {
|
|
47540
|
-
var t = !(type.flags & 465829888) ? type :
|
|
47541
|
-
isMappedTypeGenericIndexedAccess(type) ? substituteIndexedMappedType(type.objectType, type.indexType) :
|
|
47542
|
-
getBaseConstraintOfType(type) || unknownType;
|
|
47637
|
+
var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) || unknownType;
|
|
47543
47638
|
return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
|
|
47544
47639
|
t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
|
|
47545
47640
|
t.flags & 402653316 ? globalStringType :
|
|
@@ -47826,7 +47921,7 @@ var ts;
|
|
|
47826
47921
|
function isApplicableIndexType(source, target) {
|
|
47827
47922
|
return isTypeAssignableTo(source, target) ||
|
|
47828
47923
|
target === stringType && isTypeAssignableTo(source, numberType) ||
|
|
47829
|
-
target === numberType && !!(source.flags & 128) && isNumericLiteralName(source.value);
|
|
47924
|
+
target === numberType && !!(source.flags & 128) && ts.isNumericLiteralName(source.value);
|
|
47830
47925
|
}
|
|
47831
47926
|
function getIndexInfosOfStructuredType(type) {
|
|
47832
47927
|
if (type.flags & 3670016) {
|
|
@@ -50129,7 +50224,7 @@ var ts;
|
|
|
50129
50224
|
getFlowTypeOfReference(accessExpression, propType) :
|
|
50130
50225
|
propType;
|
|
50131
50226
|
}
|
|
50132
|
-
if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) {
|
|
50227
|
+
if (everyType(objectType, isTupleType) && ts.isNumericLiteralName(propName) && +propName >= 0) {
|
|
50133
50228
|
if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; }) && !(accessFlags & 16)) {
|
|
50134
50229
|
var indexNode = getIndexNodeForAccessExpression(accessNode);
|
|
50135
50230
|
if (isTupleType(objectType)) {
|
|
@@ -50384,7 +50479,7 @@ var ts;
|
|
|
50384
50479
|
return everyType(indexType, function (t) {
|
|
50385
50480
|
if (t.flags & 384) {
|
|
50386
50481
|
var propName = getPropertyNameFromType(t);
|
|
50387
|
-
if (isNumericLiteralName(propName)) {
|
|
50482
|
+
if (ts.isNumericLiteralName(propName)) {
|
|
50388
50483
|
var index = +propName;
|
|
50389
50484
|
return index >= 0 && index < limit;
|
|
50390
50485
|
}
|
|
@@ -53410,6 +53505,15 @@ var ts;
|
|
|
53410
53505
|
resetErrorInfo(saveErrorInfo);
|
|
53411
53506
|
return result;
|
|
53412
53507
|
}
|
|
53508
|
+
if (isMappedTypeGenericIndexedAccess(source)) {
|
|
53509
|
+
var indexConstraint = getConstraintOfType(source.indexType);
|
|
53510
|
+
if (indexConstraint) {
|
|
53511
|
+
if (result = isRelatedTo(getIndexedAccessType(source.objectType, indexConstraint), target, 1, reportErrors)) {
|
|
53512
|
+
resetErrorInfo(saveErrorInfo);
|
|
53513
|
+
return result;
|
|
53514
|
+
}
|
|
53515
|
+
}
|
|
53516
|
+
}
|
|
53413
53517
|
}
|
|
53414
53518
|
}
|
|
53415
53519
|
else if (source.flags & 4194304) {
|
|
@@ -53469,7 +53573,7 @@ var ts;
|
|
|
53469
53573
|
}
|
|
53470
53574
|
}
|
|
53471
53575
|
else {
|
|
53472
|
-
var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);
|
|
53576
|
+
var distributiveConstraint = hasNonCircularBaseConstraint(source) ? getConstraintOfDistributiveConditionalType(source) : undefined;
|
|
53473
53577
|
if (distributiveConstraint) {
|
|
53474
53578
|
if (result = isRelatedTo(distributiveConstraint, target, 1, reportErrors)) {
|
|
53475
53579
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -53782,7 +53886,7 @@ var ts;
|
|
|
53782
53886
|
var propName = symbolToString(unmatchedProperty);
|
|
53783
53887
|
reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
|
|
53784
53888
|
if (ts.length(unmatchedProperty.declarations)) {
|
|
53785
|
-
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics.
|
|
53889
|
+
associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
|
|
53786
53890
|
}
|
|
53787
53891
|
if (shouldSkipElaboration && errorInfo) {
|
|
53788
53892
|
overrideNextErrorInfo++;
|
|
@@ -53927,7 +54031,7 @@ var ts;
|
|
|
53927
54031
|
for (var _b = 0, _c = excludeProperties(properties, excludedProperties); _b < _c.length; _b++) {
|
|
53928
54032
|
var targetProp = _c[_b];
|
|
53929
54033
|
var name = targetProp.escapedName;
|
|
53930
|
-
if (!(targetProp.flags & 4194304) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) {
|
|
54034
|
+
if (!(targetProp.flags & 4194304) && (!numericNamesOnly || ts.isNumericLiteralName(name) || name === "length")) {
|
|
53931
54035
|
var sourceProp = getPropertyOfType(source, name);
|
|
53932
54036
|
if (sourceProp && sourceProp !== targetProp) {
|
|
53933
54037
|
var related = propertyRelatedTo(source, target, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation);
|
|
@@ -53996,7 +54100,8 @@ var ts;
|
|
|
53996
54100
|
var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
53997
54101
|
var sourceObjectFlags = ts.getObjectFlags(source);
|
|
53998
54102
|
var targetObjectFlags = ts.getObjectFlags(target);
|
|
53999
|
-
if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source.symbol === target.symbol
|
|
54103
|
+
if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source.symbol === target.symbol ||
|
|
54104
|
+
sourceObjectFlags & 4 && targetObjectFlags & 4 && source.target === target.target) {
|
|
54000
54105
|
for (var i = 0; i < targetSignatures.length; i++) {
|
|
54001
54106
|
var related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i]));
|
|
54002
54107
|
if (!related) {
|
|
@@ -54877,9 +54982,12 @@ var ts;
|
|
|
54877
54982
|
&& ((target.flags & (8 | 4 | 16)) !== 0);
|
|
54878
54983
|
}
|
|
54879
54984
|
function isObjectTypeWithInferableIndex(type) {
|
|
54880
|
-
return type.flags & 2097152
|
|
54881
|
-
|
|
54882
|
-
|
|
54985
|
+
return type.flags & 2097152
|
|
54986
|
+
? ts.every(type.types, isObjectTypeWithInferableIndex)
|
|
54987
|
+
: !!(type.symbol
|
|
54988
|
+
&& (type.symbol.flags & (4096 | 2048 | 384 | 512)) !== 0
|
|
54989
|
+
&& !(type.symbol.flags & 32)
|
|
54990
|
+
&& !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 1024 && isObjectTypeWithInferableIndex(type.source));
|
|
54883
54991
|
}
|
|
54884
54992
|
function createSymbolWithType(source, type) {
|
|
54885
54993
|
var symbol = createSymbol(source.flags, source.escapedName, ts.getCheckFlags(source) & 8);
|
|
@@ -59146,7 +59254,7 @@ var ts;
|
|
|
59146
59254
|
}
|
|
59147
59255
|
if (isTupleType(t)) {
|
|
59148
59256
|
var restType = getRestTypeOfTupleType(t);
|
|
59149
|
-
if (restType && isNumericLiteralName(name) && +name >= 0) {
|
|
59257
|
+
if (restType && ts.isNumericLiteralName(name) && +name >= 0) {
|
|
59150
59258
|
return restType;
|
|
59151
59259
|
}
|
|
59152
59260
|
}
|
|
@@ -59689,10 +59797,10 @@ var ts;
|
|
|
59689
59797
|
case 161:
|
|
59690
59798
|
return isNumericComputedName(name);
|
|
59691
59799
|
case 79:
|
|
59692
|
-
return isNumericLiteralName(name.escapedText);
|
|
59800
|
+
return ts.isNumericLiteralName(name.escapedText);
|
|
59693
59801
|
case 8:
|
|
59694
59802
|
case 10:
|
|
59695
|
-
return isNumericLiteralName(name.text);
|
|
59803
|
+
return ts.isNumericLiteralName(name.text);
|
|
59696
59804
|
default:
|
|
59697
59805
|
return false;
|
|
59698
59806
|
}
|
|
@@ -59700,9 +59808,6 @@ var ts;
|
|
|
59700
59808
|
function isNumericComputedName(name) {
|
|
59701
59809
|
return isTypeAssignableToKind(checkComputedPropertyName(name), 296);
|
|
59702
59810
|
}
|
|
59703
|
-
function isNumericLiteralName(name) {
|
|
59704
|
-
return (+name).toString() === name;
|
|
59705
|
-
}
|
|
59706
59811
|
function checkComputedPropertyName(node) {
|
|
59707
59812
|
var links = getNodeLinks(node.expression);
|
|
59708
59813
|
if (!links.resolvedType) {
|
|
@@ -59731,7 +59836,7 @@ var ts;
|
|
|
59731
59836
|
function isSymbolWithNumericName(symbol) {
|
|
59732
59837
|
var _a;
|
|
59733
59838
|
var firstDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0];
|
|
59734
|
-
return isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
|
|
59839
|
+
return ts.isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
|
|
59735
59840
|
}
|
|
59736
59841
|
function isSymbolWithSymbolName(symbol) {
|
|
59737
59842
|
var _a;
|
|
@@ -60768,6 +60873,9 @@ var ts;
|
|
|
60768
60873
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
60769
60874
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
60770
60875
|
}
|
|
60876
|
+
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 134217728) {
|
|
60877
|
+
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
60878
|
+
}
|
|
60771
60879
|
}
|
|
60772
60880
|
else {
|
|
60773
60881
|
if (prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 && isUncalledFunctionReference(node, prop)) {
|
|
@@ -60859,7 +60967,7 @@ var ts;
|
|
|
60859
60967
|
diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
60860
60968
|
}
|
|
60861
60969
|
if (diagnosticMessage) {
|
|
60862
|
-
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics.
|
|
60970
|
+
ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here, declarationName));
|
|
60863
60971
|
}
|
|
60864
60972
|
}
|
|
60865
60973
|
function isInPropertyInitializerOrClassStaticBlock(node) {
|
|
@@ -60949,7 +61057,7 @@ var ts;
|
|
|
60949
61057
|
var suggestedName = ts.symbolName(suggestion);
|
|
60950
61058
|
var message = isUncheckedJS ? ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;
|
|
60951
61059
|
errorInfo = ts.chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName);
|
|
60952
|
-
relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics.
|
|
61060
|
+
relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName);
|
|
60953
61061
|
}
|
|
60954
61062
|
else {
|
|
60955
61063
|
var diagnostic = containerSeemsToBeEmptyDomElement(containingType)
|
|
@@ -61607,7 +61715,7 @@ var ts;
|
|
|
61607
61715
|
var diag = ts.createDiagnosticForNode(node.tagName, ts.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, ts.entityNameToString(node.tagName), absoluteMinArgCount, ts.entityNameToString(factory), maxParamCount);
|
|
61608
61716
|
var tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) === null || _a === void 0 ? void 0 : _a.valueDeclaration;
|
|
61609
61717
|
if (tagNameDeclaration) {
|
|
61610
|
-
ts.addRelatedInfo(diag, ts.createDiagnosticForNode(tagNameDeclaration, ts.Diagnostics.
|
|
61718
|
+
ts.addRelatedInfo(diag, ts.createDiagnosticForNode(tagNameDeclaration, ts.Diagnostics._0_is_declared_here, ts.entityNameToString(node.tagName)));
|
|
61611
61719
|
}
|
|
61612
61720
|
if (errorOutputContainer && errorOutputContainer.skipLogging) {
|
|
61613
61721
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
|
|
@@ -67415,7 +67523,7 @@ var ts;
|
|
|
67415
67523
|
var declName = ts.declarationNameToString(nextDeclarationName);
|
|
67416
67524
|
var err = error(nextDeclarationName, message, declName, typeToString(firstType), typeToString(nextType));
|
|
67417
67525
|
if (firstDeclaration) {
|
|
67418
|
-
ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics.
|
|
67526
|
+
ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics._0_was_also_declared_here, declName));
|
|
67419
67527
|
}
|
|
67420
67528
|
}
|
|
67421
67529
|
function areDeclarationFlagsIdentical(left, right) {
|
|
@@ -69044,7 +69152,7 @@ var ts;
|
|
|
69044
69152
|
}
|
|
69045
69153
|
else {
|
|
69046
69154
|
var text = ts.getTextOfPropertyName(member.name);
|
|
69047
|
-
if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
|
|
69155
|
+
if (ts.isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
|
|
69048
69156
|
error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
|
69049
69157
|
}
|
|
69050
69158
|
}
|
|
@@ -69763,9 +69871,9 @@ var ts;
|
|
|
69763
69871
|
error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
|
|
69764
69872
|
}
|
|
69765
69873
|
}
|
|
69766
|
-
var
|
|
69767
|
-
if (
|
|
69768
|
-
|
|
69874
|
+
var exports_3 = getExportsOfModule(moduleSymbol);
|
|
69875
|
+
if (exports_3) {
|
|
69876
|
+
exports_3.forEach(function (_a, id) {
|
|
69769
69877
|
var declarations = _a.declarations, flags = _a.flags;
|
|
69770
69878
|
if (id === "__export") {
|
|
69771
69879
|
return;
|
|
@@ -77488,6 +77596,8 @@ var ts;
|
|
|
77488
77596
|
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
|
|
77489
77597
|
ts.setCommentRange(statement, property);
|
|
77490
77598
|
ts.setOriginalNode(statement, property);
|
|
77599
|
+
ts.setSyntheticLeadingComments(expression, undefined);
|
|
77600
|
+
ts.setSyntheticTrailingComments(expression, undefined);
|
|
77491
77601
|
statements.push(statement);
|
|
77492
77602
|
}
|
|
77493
77603
|
}
|
|
@@ -93440,8 +93550,8 @@ var ts;
|
|
|
93440
93550
|
var gutterSeparator = " ";
|
|
93441
93551
|
var resetEscapeSequence = "\u001b[0m";
|
|
93442
93552
|
var ellipsis = "...";
|
|
93443
|
-
var bullet = "● ";
|
|
93444
93553
|
var halfIndent = " ";
|
|
93554
|
+
var indent = " ";
|
|
93445
93555
|
function getCategoryFormat(category) {
|
|
93446
93556
|
switch (category) {
|
|
93447
93557
|
case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;
|
|
@@ -93454,21 +93564,14 @@ var ts;
|
|
|
93454
93564
|
return formatStyle + text + resetEscapeSequence;
|
|
93455
93565
|
}
|
|
93456
93566
|
ts.formatColorAndReset = formatColorAndReset;
|
|
93457
|
-
function formatCodeSpan(file, start, length, indent,
|
|
93567
|
+
function formatCodeSpan(file, start, length, indent, squiggleColor, host) {
|
|
93458
93568
|
var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character;
|
|
93459
93569
|
var _b = ts.getLineAndCharacterOfPosition(file, start + length), lastLine = _b.line, lastLineChar = _b.character;
|
|
93460
93570
|
var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line;
|
|
93461
|
-
var gutterWidth = 1;
|
|
93462
93571
|
var hasMoreThanFiveLines = (lastLine - firstLine) >= 4;
|
|
93463
|
-
var
|
|
93464
|
-
|
|
93465
|
-
|
|
93466
|
-
i = lastLine - 1;
|
|
93467
|
-
}
|
|
93468
|
-
var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0);
|
|
93469
|
-
var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
93470
|
-
var lineContent = file.text.slice(lineStart, lineEnd);
|
|
93471
|
-
whitespaceToTrim = Math.min(whitespaceToTrim, ts.startWhitespaceCount(lineContent));
|
|
93572
|
+
var gutterWidth = (lastLine + 1 + "").length;
|
|
93573
|
+
if (hasMoreThanFiveLines) {
|
|
93574
|
+
gutterWidth = Math.max(ellipsis.length, gutterWidth);
|
|
93472
93575
|
}
|
|
93473
93576
|
var context = "";
|
|
93474
93577
|
for (var i = firstLine; i <= lastLine; i++) {
|
|
@@ -93481,24 +93584,21 @@ var ts;
|
|
|
93481
93584
|
var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
93482
93585
|
var lineContent = file.text.slice(lineStart, lineEnd);
|
|
93483
93586
|
lineContent = ts.trimStringEnd(lineContent);
|
|
93484
|
-
lineContent = lineContent.slice(whitespaceToTrim);
|
|
93485
93587
|
lineContent = lineContent.replace(/\t/g, " ");
|
|
93486
|
-
|
|
93487
|
-
context += indent + ts.padLeft(gutterLine, gutterWidth) + gutterSeparator;
|
|
93588
|
+
context += indent + formatColorAndReset(ts.padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
|
|
93488
93589
|
context += lineContent + host.getNewLine();
|
|
93489
|
-
context += indent + ts.padLeft("", gutterWidth) + gutterSeparator;
|
|
93490
|
-
context +=
|
|
93590
|
+
context += indent + formatColorAndReset(ts.padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
|
|
93591
|
+
context += squiggleColor;
|
|
93491
93592
|
if (i === firstLine) {
|
|
93492
93593
|
var lastCharForLine = i === lastLine ? lastLineChar : undefined;
|
|
93493
|
-
context += lineContent.slice(0, firstLineChar
|
|
93494
|
-
|
|
93495
|
-
context += lineContent.slice(firstLineChar - whitespaceToTrim, amendedLastChar).replace(/./g, "▔");
|
|
93594
|
+
context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
|
|
93595
|
+
context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~");
|
|
93496
93596
|
}
|
|
93497
93597
|
else if (i === lastLine) {
|
|
93498
|
-
context += lineContent.slice(0, lastLineChar).replace(/./g, "
|
|
93598
|
+
context += lineContent.slice(0, lastLineChar).replace(/./g, "~");
|
|
93499
93599
|
}
|
|
93500
93600
|
else {
|
|
93501
|
-
context += lineContent.replace(/./g, "
|
|
93601
|
+
context += lineContent.replace(/./g, "~");
|
|
93502
93602
|
}
|
|
93503
93603
|
context += resetEscapeSequence;
|
|
93504
93604
|
}
|
|
@@ -93518,50 +93618,41 @@ var ts;
|
|
|
93518
93618
|
}
|
|
93519
93619
|
ts.formatLocation = formatLocation;
|
|
93520
93620
|
function formatDiagnosticsWithColorAndContext(diagnostics, host) {
|
|
93521
|
-
var _a, _b;
|
|
93522
|
-
var terminalWidth = (_b = (_a = ts.sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(ts.sys)) !== null && _b !== void 0 ? _b : 0;
|
|
93523
|
-
var indent = terminalWidth < 60 ? "" : halfIndent;
|
|
93524
93621
|
var output = "";
|
|
93525
93622
|
for (var _i = 0, diagnostics_4 = diagnostics; _i < diagnostics_4.length; _i++) {
|
|
93526
93623
|
var diagnostic = diagnostics_4[_i];
|
|
93527
|
-
var diagnosticCode = "TS" + diagnostic.code;
|
|
93528
93624
|
if (diagnostic.file) {
|
|
93529
93625
|
var file = diagnostic.file, start = diagnostic.start;
|
|
93530
|
-
|
|
93531
|
-
|
|
93532
|
-
|
|
93533
|
-
|
|
93534
|
-
|
|
93535
|
-
|
|
93536
|
-
|
|
93537
|
-
padWidth = defaultPad;
|
|
93538
|
-
output += ts.padLeft(diagnosticCode, padWidth);
|
|
93539
|
-
output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, indent, getCategoryFormat(diagnostic.category), host);
|
|
93626
|
+
output += formatLocation(file, start, host);
|
|
93627
|
+
output += " - ";
|
|
93628
|
+
}
|
|
93629
|
+
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
93630
|
+
output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
|
|
93631
|
+
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
93632
|
+
if (diagnostic.file) {
|
|
93540
93633
|
output += host.getNewLine();
|
|
93634
|
+
output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host);
|
|
93541
93635
|
}
|
|
93542
|
-
var diagnosticText = flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine(), 0, true);
|
|
93543
|
-
diagnosticText = ts.map(diagnosticText.split(host.getNewLine()), function (text) { return indent + text; }).join(host.getNewLine());
|
|
93544
|
-
output += diagnosticText;
|
|
93545
|
-
output += host.getNewLine();
|
|
93546
93636
|
if (diagnostic.relatedInformation) {
|
|
93547
93637
|
output += host.getNewLine();
|
|
93548
|
-
for (var
|
|
93549
|
-
var
|
|
93550
|
-
output += ts.trimStringStart(flattenDiagnosticMessageText(messageText, host.getNewLine(), 0, true));
|
|
93638
|
+
for (var _a = 0, _b = diagnostic.relatedInformation; _a < _b.length; _a++) {
|
|
93639
|
+
var _c = _b[_a], file = _c.file, start = _c.start, length_9 = _c.length, messageText = _c.messageText;
|
|
93551
93640
|
if (file) {
|
|
93552
|
-
output += " " + formatLocation(file, start, host);
|
|
93553
93641
|
output += host.getNewLine();
|
|
93554
|
-
output +=
|
|
93642
|
+
output += halfIndent + formatLocation(file, start, host);
|
|
93643
|
+
output += formatCodeSpan(file, start, length_9, indent, ForegroundColorEscapeSequences.Cyan, host);
|
|
93555
93644
|
}
|
|
93645
|
+
output += host.getNewLine();
|
|
93646
|
+
output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
|
|
93556
93647
|
}
|
|
93557
93648
|
}
|
|
93649
|
+
output += host.getNewLine();
|
|
93558
93650
|
}
|
|
93559
93651
|
return output;
|
|
93560
93652
|
}
|
|
93561
93653
|
ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext;
|
|
93562
|
-
function flattenDiagnosticMessageText(diag, newLine, indent
|
|
93654
|
+
function flattenDiagnosticMessageText(diag, newLine, indent) {
|
|
93563
93655
|
if (indent === void 0) { indent = 0; }
|
|
93564
|
-
if (pretty === void 0) { pretty = false; }
|
|
93565
93656
|
if (ts.isString(diag)) {
|
|
93566
93657
|
return diag;
|
|
93567
93658
|
}
|
|
@@ -93571,14 +93662,9 @@ var ts;
|
|
|
93571
93662
|
var result = "";
|
|
93572
93663
|
if (indent) {
|
|
93573
93664
|
result += newLine;
|
|
93574
|
-
var
|
|
93575
|
-
|
|
93576
|
-
for (var i = indentsToReplaceWithNewLines; i < indent; i++) {
|
|
93577
|
-
result += " ";
|
|
93578
|
-
}
|
|
93665
|
+
for (var i = 0; i < indent; i++) {
|
|
93666
|
+
result += " ";
|
|
93579
93667
|
}
|
|
93580
|
-
else
|
|
93581
|
-
result += newLine;
|
|
93582
93668
|
}
|
|
93583
93669
|
result += diag.messageText;
|
|
93584
93670
|
indent++;
|
|
@@ -98458,27 +98544,27 @@ var ts;
|
|
|
98458
98544
|
useCaseSensitiveFileNames: (_a = host.useCaseSensitiveFileNames) === null || _a === void 0 ? void 0 : _a.call(host),
|
|
98459
98545
|
};
|
|
98460
98546
|
}
|
|
98461
|
-
function updateModuleSpecifier(compilerOptions, importingSourceFileName, toFileName, host, oldImportSpecifier) {
|
|
98462
|
-
var res = getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {});
|
|
98547
|
+
function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, oldImportSpecifier) {
|
|
98548
|
+
var res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {});
|
|
98463
98549
|
if (res === oldImportSpecifier)
|
|
98464
98550
|
return undefined;
|
|
98465
98551
|
return res;
|
|
98466
98552
|
}
|
|
98467
98553
|
moduleSpecifiers_1.updateModuleSpecifier = updateModuleSpecifier;
|
|
98468
98554
|
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host) {
|
|
98469
|
-
return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
|
|
98555
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
|
|
98470
98556
|
}
|
|
98471
98557
|
moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier;
|
|
98472
|
-
function getNodeModulesPackageName(compilerOptions,
|
|
98473
|
-
var info = getInfo(
|
|
98474
|
-
var modulePaths = getAllModulePaths(
|
|
98475
|
-
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, true); });
|
|
98558
|
+
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences) {
|
|
98559
|
+
var info = getInfo(importingSourceFile.path, host);
|
|
98560
|
+
var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences);
|
|
98561
|
+
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, true); });
|
|
98476
98562
|
}
|
|
98477
98563
|
moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
|
|
98478
|
-
function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences, userPreferences) {
|
|
98564
|
+
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences) {
|
|
98479
98565
|
var info = getInfo(importingSourceFileName, host);
|
|
98480
98566
|
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences);
|
|
98481
|
-
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) ||
|
|
98567
|
+
return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions); }) ||
|
|
98482
98568
|
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
|
|
98483
98569
|
}
|
|
98484
98570
|
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences) {
|
|
@@ -98537,7 +98623,7 @@ var ts;
|
|
|
98537
98623
|
var relativeSpecifiers;
|
|
98538
98624
|
for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {
|
|
98539
98625
|
var modulePath = modulePaths_1[_i];
|
|
98540
|
-
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions);
|
|
98626
|
+
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions);
|
|
98541
98627
|
nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);
|
|
98542
98628
|
if (specifier && modulePath.isRedirect) {
|
|
98543
98629
|
return nodeModulesSpecifiers;
|
|
@@ -98867,7 +98953,7 @@ var ts;
|
|
|
98867
98953
|
? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
|
|
98868
98954
|
: ts.removeFileExtension(relativePath);
|
|
98869
98955
|
}
|
|
98870
|
-
function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) {
|
|
98956
|
+
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly) {
|
|
98871
98957
|
var path = _a.path, isRedirect = _a.isRedirect;
|
|
98872
98958
|
var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;
|
|
98873
98959
|
if (!host.fileExists || !host.readFile) {
|
|
@@ -98924,9 +99010,14 @@ var ts;
|
|
|
98924
99010
|
if (host.fileExists(packageJsonPath)) {
|
|
98925
99011
|
var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));
|
|
98926
99012
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
98927
|
-
var
|
|
99013
|
+
var conditions = ["node", importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
|
|
99014
|
+
var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
|
99015
|
+
? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
|
|
99016
|
+
: undefined;
|
|
98928
99017
|
if (fromExports) {
|
|
98929
|
-
var withJsExtension = !ts.hasTSFileExtension(fromExports.moduleFileToTry)
|
|
99018
|
+
var withJsExtension = !ts.hasTSFileExtension(fromExports.moduleFileToTry)
|
|
99019
|
+
? fromExports
|
|
99020
|
+
: { moduleFileToTry: ts.removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
|
|
98930
99021
|
return __assign(__assign({}, withJsExtension), { verbatimFromExports: true });
|
|
98931
99022
|
}
|
|
98932
99023
|
if (packageJsonContent.exports) {
|
|
@@ -99018,7 +99109,7 @@ var ts;
|
|
|
99018
99109
|
function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
|
|
99019
99110
|
return ts.firstDefined(rootDirs, function (rootDir) {
|
|
99020
99111
|
var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
|
|
99021
|
-
return isPathRelativeToParent(relativePath) ? undefined : relativePath;
|
|
99112
|
+
return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
|
|
99022
99113
|
});
|
|
99023
99114
|
}
|
|
99024
99115
|
function removeExtensionAndIndexPostFix(fileName, ending, options) {
|
|
@@ -99184,7 +99275,7 @@ var ts;
|
|
|
99184
99275
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99185
99276
|
}
|
|
99186
99277
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99187
|
-
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
99278
|
+
function getErrorSummaryText(errorCount, filesInError, newLine, host) {
|
|
99188
99279
|
if (errorCount === 0)
|
|
99189
99280
|
return "";
|
|
99190
99281
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
@@ -99199,10 +99290,10 @@ var ts;
|
|
|
99199
99290
|
distinctFileNamesWithLines.length === 1 ?
|
|
99200
99291
|
ts.Diagnostics.Found_0_errors_in_1_file :
|
|
99201
99292
|
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
99202
|
-
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
|
|
99293
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "");
|
|
99203
99294
|
}
|
|
99204
99295
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99205
|
-
function createTabularErrorsDisplay(filesInError) {
|
|
99296
|
+
function createTabularErrorsDisplay(filesInError, host) {
|
|
99206
99297
|
var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
|
|
99207
99298
|
if (distinctFiles.length === 0)
|
|
99208
99299
|
return "";
|
|
@@ -99221,7 +99312,8 @@ var ts;
|
|
|
99221
99312
|
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
99222
99313
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99223
99314
|
: "";
|
|
99224
|
-
|
|
99315
|
+
var relativePath = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), file.fileName, false);
|
|
99316
|
+
tabularData += "" + leftPadding + errorCount + " " + relativePath + ":" + file.line + "\n";
|
|
99225
99317
|
});
|
|
99226
99318
|
return tabularData;
|
|
99227
99319
|
}
|
|
@@ -99603,7 +99695,7 @@ var ts;
|
|
|
99603
99695
|
var system = input.system || ts.sys;
|
|
99604
99696
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
99605
99697
|
var builderProgram = ts.createIncrementalProgram(input);
|
|
99606
|
-
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
|
|
99698
|
+
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine, host)); } : undefined);
|
|
99607
99699
|
if (input.afterProgramEmitAndDiagnostics)
|
|
99608
99700
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
99609
99701
|
return exitStatus;
|
|
@@ -102313,7 +102405,7 @@ var ts;
|
|
|
102313
102405
|
}
|
|
102314
102406
|
function createReportErrorSummary(sys, options) {
|
|
102315
102407
|
return shouldBePretty(sys, options) ?
|
|
102316
|
-
function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
|
|
102408
|
+
function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine, sys)); } :
|
|
102317
102409
|
undefined;
|
|
102318
102410
|
}
|
|
102319
102411
|
function performCompilation(sys, cb, reportDiagnostic, config) {
|