@typescript-deploys/pr-build 4.6.0-pr-47183-2 → 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/lib.es2020.intl.d.ts +1 -0
- package/lib/lib.es2022.error.d.ts +50 -3
- package/lib/tsc.js +272 -124
- package/lib/tsserver.js +672 -346
- package/lib/tsserverlibrary.d.ts +5 -3
- package/lib/tsserverlibrary.js +643 -345
- package/lib/typescript.d.ts +4 -3
- package/lib/typescript.js +585 -323
- package/lib/typescriptServices.d.ts +4 -3
- package/lib/typescriptServices.js +585 -323
- package/lib/typingsInstaller.js +467 -242
- 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() {
|
|
@@ -11002,7 +11002,8 @@ var ts;
|
|
|
11002
11002
|
Float64Array: ["at"],
|
|
11003
11003
|
BigInt64Array: ["at"],
|
|
11004
11004
|
BigUint64Array: ["at"],
|
|
11005
|
-
ObjectConstructor: ["hasOwn"]
|
|
11005
|
+
ObjectConstructor: ["hasOwn"],
|
|
11006
|
+
Error: ["cause"]
|
|
11006
11007
|
}
|
|
11007
11008
|
};
|
|
11008
11009
|
}
|
|
@@ -15678,16 +15679,6 @@ var ts;
|
|
|
15678
15679
|
(symlinkedDirectories || (symlinkedDirectories = new ts.Map())).set(symlinkPath, real);
|
|
15679
15680
|
}
|
|
15680
15681
|
},
|
|
15681
|
-
setSymlinkedDirectoryFromSymlinkedFile: function (symlink, real) {
|
|
15682
|
-
this.setSymlinkedFile(ts.toPath(symlink, cwd, getCanonicalFileName), real);
|
|
15683
|
-
var _a = guessDirectorySymlink(real, symlink, cwd, getCanonicalFileName) || ts.emptyArray, commonResolved = _a[0], commonOriginal = _a[1];
|
|
15684
|
-
if (commonResolved && commonOriginal) {
|
|
15685
|
-
this.setSymlinkedDirectory(commonOriginal, {
|
|
15686
|
-
real: commonResolved,
|
|
15687
|
-
realPath: ts.toPath(commonResolved, cwd, getCanonicalFileName),
|
|
15688
|
-
});
|
|
15689
|
-
}
|
|
15690
|
-
},
|
|
15691
15682
|
setSymlinksFromResolutions: function (files, typeReferenceDirectives) {
|
|
15692
15683
|
var _this = this;
|
|
15693
15684
|
var _a;
|
|
@@ -16525,9 +16516,19 @@ var ts;
|
|
|
16525
16516
|
}
|
|
16526
16517
|
ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
|
|
16527
16518
|
function escapeSnippetText(text) {
|
|
16528
|
-
return text.replace(/\$/gm, "\\$");
|
|
16519
|
+
return text.replace(/\$/gm, function () { return "\\$"; });
|
|
16529
16520
|
}
|
|
16530
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;
|
|
16531
16532
|
function isThisTypeParameter(type) {
|
|
16532
16533
|
return !!(type.flags & 262144 && type.isThisType);
|
|
16533
16534
|
}
|
|
@@ -17785,7 +17786,7 @@ var ts;
|
|
|
17785
17786
|
result.push(createModifier(144));
|
|
17786
17787
|
if (flags & 256)
|
|
17787
17788
|
result.push(createModifier(131));
|
|
17788
|
-
return result;
|
|
17789
|
+
return result.length ? result : undefined;
|
|
17789
17790
|
}
|
|
17790
17791
|
function createQualifiedName(left, right) {
|
|
17791
17792
|
var node = createBaseNode(160);
|
|
@@ -21036,32 +21037,36 @@ var ts;
|
|
|
21036
21037
|
}
|
|
21037
21038
|
function updateModifiers(node, modifiers) {
|
|
21038
21039
|
var _a;
|
|
21040
|
+
var modifierArray;
|
|
21039
21041
|
if (typeof modifiers === "number") {
|
|
21040
|
-
|
|
21041
|
-
}
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
|
|
21057
|
-
|
|
21058
|
-
|
|
21059
|
-
|
|
21060
|
-
|
|
21061
|
-
|
|
21062
|
-
|
|
21063
|
-
|
|
21064
|
-
|
|
21042
|
+
modifierArray = createModifiersFromModifierFlags(modifiers);
|
|
21043
|
+
}
|
|
21044
|
+
else {
|
|
21045
|
+
modifierArray = modifiers;
|
|
21046
|
+
}
|
|
21047
|
+
return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
|
|
21048
|
+
ts.isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) :
|
|
21049
|
+
ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifierArray, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
|
|
21050
|
+
ts.isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
|
|
21051
|
+
ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
|
|
21052
|
+
ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifierArray, node.parameters, node.body) :
|
|
21053
|
+
ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.type, node.body) :
|
|
21054
|
+
ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.body) :
|
|
21055
|
+
ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifierArray, node.parameters, node.type) :
|
|
21056
|
+
ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
|
|
21057
|
+
ts.isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
|
|
21058
|
+
ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
|
|
21059
|
+
ts.isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) :
|
|
21060
|
+
ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
|
|
21061
|
+
ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
|
|
21062
|
+
ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
|
|
21063
|
+
ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.type) :
|
|
21064
|
+
ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifierArray, node.name, node.members) :
|
|
21065
|
+
ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifierArray, node.name, node.body) :
|
|
21066
|
+
ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.name, node.moduleReference) :
|
|
21067
|
+
ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) :
|
|
21068
|
+
ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifierArray, node.expression) :
|
|
21069
|
+
ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
|
|
21065
21070
|
ts.Debug.assertNever(node);
|
|
21066
21071
|
}
|
|
21067
21072
|
function asNodeArray(array) {
|
|
@@ -33831,9 +33836,7 @@ var ts;
|
|
|
33831
33836
|
}
|
|
33832
33837
|
}
|
|
33833
33838
|
var failedLookupLocations = [];
|
|
33834
|
-
var features =
|
|
33835
|
-
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
33836
|
-
NodeResolutionFeatures.None;
|
|
33839
|
+
var features = getDefaultNodeResolutionFeatures(options);
|
|
33837
33840
|
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
33838
33841
|
var resolved = primaryLookup();
|
|
33839
33842
|
var primary = true;
|
|
@@ -33916,6 +33919,30 @@ var ts;
|
|
|
33916
33919
|
}
|
|
33917
33920
|
}
|
|
33918
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;
|
|
33919
33946
|
function getAutomaticTypeDirectiveNames(options, host) {
|
|
33920
33947
|
if (options.types) {
|
|
33921
33948
|
return options.types;
|
|
@@ -34375,10 +34402,6 @@ var ts;
|
|
|
34375
34402
|
return resolvedModule.resolvedFileName;
|
|
34376
34403
|
}
|
|
34377
34404
|
ts.resolveJSModule = resolveJSModule;
|
|
34378
|
-
function tryResolveJSModule(moduleName, initialDir, host) {
|
|
34379
|
-
return tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;
|
|
34380
|
-
}
|
|
34381
|
-
ts.tryResolveJSModule = tryResolveJSModule;
|
|
34382
34405
|
var NodeResolutionFeatures;
|
|
34383
34406
|
(function (NodeResolutionFeatures) {
|
|
34384
34407
|
NodeResolutionFeatures[NodeResolutionFeatures["None"] = 0] = "None";
|
|
@@ -34652,6 +34675,91 @@ var ts;
|
|
|
34652
34675
|
var versionPaths = packageInfo && packageInfo.versionPaths;
|
|
34653
34676
|
return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
|
|
34654
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
|
+
}
|
|
34655
34763
|
function getPackageScopeForPath(fileName, packageJsonInfoCache, host, options) {
|
|
34656
34764
|
var state = {
|
|
34657
34765
|
host: host,
|
|
@@ -34703,7 +34811,7 @@ var ts;
|
|
|
34703
34811
|
trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
34704
34812
|
}
|
|
34705
34813
|
var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);
|
|
34706
|
-
var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths };
|
|
34814
|
+
var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths, resolvedEntrypoints: undefined };
|
|
34707
34815
|
(_b = state.packageJsonInfoCache) === null || _b === void 0 ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result);
|
|
34708
34816
|
return result;
|
|
34709
34817
|
}
|
|
@@ -34985,8 +35093,8 @@ var ts;
|
|
|
34985
35093
|
}
|
|
34986
35094
|
return toSearchResult(undefined);
|
|
34987
35095
|
}
|
|
34988
|
-
for (var _d = 0,
|
|
34989
|
-
var elem =
|
|
35096
|
+
for (var _d = 0, target_2 = target; _d < target_2.length; _d++) {
|
|
35097
|
+
var elem = target_2[_d];
|
|
34990
35098
|
var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
|
|
34991
35099
|
if (result) {
|
|
34992
35100
|
return result;
|
|
@@ -38295,6 +38403,7 @@ var ts;
|
|
|
38295
38403
|
var location = ts.getParseTreeNode(locationIn);
|
|
38296
38404
|
return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;
|
|
38297
38405
|
},
|
|
38406
|
+
getTypeOfSymbol: getTypeOfSymbol,
|
|
38298
38407
|
getSymbolsOfParameterPropertyDeclaration: function (parameterIn, parameterName) {
|
|
38299
38408
|
var parameter = ts.getParseTreeNode(parameterIn, ts.isParameter);
|
|
38300
38409
|
if (parameter === undefined)
|
|
@@ -40929,7 +41038,7 @@ var ts;
|
|
|
40929
41038
|
if (!sigs || !sigs.length) {
|
|
40930
41039
|
sigs = getSignaturesOfStructuredType(type, 1);
|
|
40931
41040
|
}
|
|
40932
|
-
if ((sigs && sigs.length) || getPropertyOfType(type, "default")) {
|
|
41041
|
+
if ((sigs && sigs.length) || getPropertyOfType(type, "default", true)) {
|
|
40933
41042
|
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
|
|
40934
41043
|
return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
|
|
40935
41044
|
}
|
|
@@ -42933,8 +43042,8 @@ var ts;
|
|
|
42933
43042
|
}
|
|
42934
43043
|
else {
|
|
42935
43044
|
if (parent && getExportsOfSymbol(parent)) {
|
|
42936
|
-
var
|
|
42937
|
-
ts.forEachEntry(
|
|
43045
|
+
var exports_2 = getExportsOfSymbol(parent);
|
|
43046
|
+
ts.forEachEntry(exports_2, function (ex, name) {
|
|
42938
43047
|
if (getSymbolIfSameReference(ex, symbol) && !isLateBoundName(name) && name !== "export=") {
|
|
42939
43048
|
symbolName = ts.unescapeLeadingUnderscores(name);
|
|
42940
43049
|
return true;
|
|
@@ -43092,31 +43201,26 @@ var ts;
|
|
|
43092
43201
|
}
|
|
43093
43202
|
var rawName = ts.unescapeLeadingUnderscores(symbol.escapedName);
|
|
43094
43203
|
var stringNamed = !!ts.length(symbol.declarations) && ts.every(symbol.declarations, isStringNamed);
|
|
43095
|
-
return createPropertyNameNodeForIdentifierOrLiteral(rawName,
|
|
43204
|
+
return ts.createPropertyNameNodeForIdentifierOrLiteral(rawName, ts.getEmitScriptTarget(compilerOptions), singleQuote, stringNamed);
|
|
43096
43205
|
}
|
|
43097
43206
|
function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote) {
|
|
43098
43207
|
var nameType = getSymbolLinks(symbol).nameType;
|
|
43099
43208
|
if (nameType) {
|
|
43100
43209
|
if (nameType.flags & 384) {
|
|
43101
43210
|
var name = "" + nameType.value;
|
|
43102
|
-
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
43211
|
+
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
43103
43212
|
return ts.factory.createStringLiteral(name, !!singleQuote);
|
|
43104
43213
|
}
|
|
43105
|
-
if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
43214
|
+
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
43106
43215
|
return ts.factory.createComputedPropertyName(ts.factory.createNumericLiteral(+name));
|
|
43107
43216
|
}
|
|
43108
|
-
return createPropertyNameNodeForIdentifierOrLiteral(name);
|
|
43217
|
+
return ts.createPropertyNameNodeForIdentifierOrLiteral(name, ts.getEmitScriptTarget(compilerOptions));
|
|
43109
43218
|
}
|
|
43110
43219
|
if (nameType.flags & 8192) {
|
|
43111
43220
|
return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551));
|
|
43112
43221
|
}
|
|
43113
43222
|
}
|
|
43114
43223
|
}
|
|
43115
|
-
function createPropertyNameNodeForIdentifierOrLiteral(name, stringNamed, singleQuote) {
|
|
43116
|
-
return ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) ? ts.factory.createIdentifier(name) :
|
|
43117
|
-
!stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
|
|
43118
|
-
ts.factory.createStringLiteral(name, !!singleQuote);
|
|
43119
|
-
}
|
|
43120
43224
|
function cloneNodeBuilderContext(context) {
|
|
43121
43225
|
var initial = __assign({}, context);
|
|
43122
43226
|
if (initial.typeParameterNames) {
|
|
@@ -44312,10 +44416,10 @@ var ts;
|
|
|
44312
44416
|
if (nameType) {
|
|
44313
44417
|
if (nameType.flags & 384) {
|
|
44314
44418
|
var name = "" + nameType.value;
|
|
44315
|
-
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
|
|
44419
|
+
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
44316
44420
|
return "\"" + ts.escapeString(name, 34) + "\"";
|
|
44317
44421
|
}
|
|
44318
|
-
if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
44422
|
+
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
44319
44423
|
return "[" + name + "]";
|
|
44320
44424
|
}
|
|
44321
44425
|
return name;
|
|
@@ -47290,6 +47394,9 @@ var ts;
|
|
|
47290
47394
|
return simplified !== type ? simplified : getConstraintOfType(type);
|
|
47291
47395
|
}
|
|
47292
47396
|
function getConstraintFromIndexedAccess(type) {
|
|
47397
|
+
if (isMappedTypeGenericIndexedAccess(type)) {
|
|
47398
|
+
return substituteIndexedMappedType(type.objectType, type.indexType);
|
|
47399
|
+
}
|
|
47293
47400
|
var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
|
|
47294
47401
|
if (indexConstraint && indexConstraint !== type.indexType) {
|
|
47295
47402
|
var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.accessFlags);
|
|
@@ -47458,6 +47565,9 @@ var ts;
|
|
|
47458
47565
|
return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
47459
47566
|
}
|
|
47460
47567
|
if (t.flags & 8388608) {
|
|
47568
|
+
if (isMappedTypeGenericIndexedAccess(t)) {
|
|
47569
|
+
return getBaseConstraint(substituteIndexedMappedType(t.objectType, t.indexType));
|
|
47570
|
+
}
|
|
47461
47571
|
var baseObjectType = getBaseConstraint(t.objectType);
|
|
47462
47572
|
var baseIndexType = getBaseConstraint(t.indexType);
|
|
47463
47573
|
var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.accessFlags);
|
|
@@ -47524,9 +47634,7 @@ var ts;
|
|
|
47524
47634
|
!isGenericMappedType(type.objectType) && isGenericIndexType(type.indexType);
|
|
47525
47635
|
}
|
|
47526
47636
|
function getApparentType(type) {
|
|
47527
|
-
var t = !(type.flags & 465829888) ? type :
|
|
47528
|
-
isMappedTypeGenericIndexedAccess(type) ? substituteIndexedMappedType(type.objectType, type.indexType) :
|
|
47529
|
-
getBaseConstraintOfType(type) || unknownType;
|
|
47637
|
+
var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) || unknownType;
|
|
47530
47638
|
return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
|
|
47531
47639
|
t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
|
|
47532
47640
|
t.flags & 402653316 ? globalStringType :
|
|
@@ -47767,7 +47875,7 @@ var ts;
|
|
|
47767
47875
|
return symbol_1;
|
|
47768
47876
|
}
|
|
47769
47877
|
}
|
|
47770
|
-
return
|
|
47878
|
+
return getPropertyOfObjectType(globalObjectType, name);
|
|
47771
47879
|
}
|
|
47772
47880
|
if (type.flags & 3145728) {
|
|
47773
47881
|
return getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment);
|
|
@@ -47813,7 +47921,7 @@ var ts;
|
|
|
47813
47921
|
function isApplicableIndexType(source, target) {
|
|
47814
47922
|
return isTypeAssignableTo(source, target) ||
|
|
47815
47923
|
target === stringType && isTypeAssignableTo(source, numberType) ||
|
|
47816
|
-
target === numberType && !!(source.flags & 128) && isNumericLiteralName(source.value);
|
|
47924
|
+
target === numberType && !!(source.flags & 128) && ts.isNumericLiteralName(source.value);
|
|
47817
47925
|
}
|
|
47818
47926
|
function getIndexInfosOfStructuredType(type) {
|
|
47819
47927
|
if (type.flags & 3670016) {
|
|
@@ -50116,7 +50224,7 @@ var ts;
|
|
|
50116
50224
|
getFlowTypeOfReference(accessExpression, propType) :
|
|
50117
50225
|
propType;
|
|
50118
50226
|
}
|
|
50119
|
-
if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) {
|
|
50227
|
+
if (everyType(objectType, isTupleType) && ts.isNumericLiteralName(propName) && +propName >= 0) {
|
|
50120
50228
|
if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; }) && !(accessFlags & 16)) {
|
|
50121
50229
|
var indexNode = getIndexNodeForAccessExpression(accessNode);
|
|
50122
50230
|
if (isTupleType(objectType)) {
|
|
@@ -50371,7 +50479,7 @@ var ts;
|
|
|
50371
50479
|
return everyType(indexType, function (t) {
|
|
50372
50480
|
if (t.flags & 384) {
|
|
50373
50481
|
var propName = getPropertyNameFromType(t);
|
|
50374
|
-
if (isNumericLiteralName(propName)) {
|
|
50482
|
+
if (ts.isNumericLiteralName(propName)) {
|
|
50375
50483
|
var index = +propName;
|
|
50376
50484
|
return index >= 0 && index < limit;
|
|
50377
50485
|
}
|
|
@@ -53397,6 +53505,15 @@ var ts;
|
|
|
53397
53505
|
resetErrorInfo(saveErrorInfo);
|
|
53398
53506
|
return result;
|
|
53399
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
|
+
}
|
|
53400
53517
|
}
|
|
53401
53518
|
}
|
|
53402
53519
|
else if (source.flags & 4194304) {
|
|
@@ -53456,7 +53573,7 @@ var ts;
|
|
|
53456
53573
|
}
|
|
53457
53574
|
}
|
|
53458
53575
|
else {
|
|
53459
|
-
var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);
|
|
53576
|
+
var distributiveConstraint = hasNonCircularBaseConstraint(source) ? getConstraintOfDistributiveConditionalType(source) : undefined;
|
|
53460
53577
|
if (distributiveConstraint) {
|
|
53461
53578
|
if (result = isRelatedTo(distributiveConstraint, target, 1, reportErrors)) {
|
|
53462
53579
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -53914,7 +54031,7 @@ var ts;
|
|
|
53914
54031
|
for (var _b = 0, _c = excludeProperties(properties, excludedProperties); _b < _c.length; _b++) {
|
|
53915
54032
|
var targetProp = _c[_b];
|
|
53916
54033
|
var name = targetProp.escapedName;
|
|
53917
|
-
if (!(targetProp.flags & 4194304) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) {
|
|
54034
|
+
if (!(targetProp.flags & 4194304) && (!numericNamesOnly || ts.isNumericLiteralName(name) || name === "length")) {
|
|
53918
54035
|
var sourceProp = getPropertyOfType(source, name);
|
|
53919
54036
|
if (sourceProp && sourceProp !== targetProp) {
|
|
53920
54037
|
var related = propertyRelatedTo(source, target, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation);
|
|
@@ -53983,7 +54100,8 @@ var ts;
|
|
|
53983
54100
|
var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
53984
54101
|
var sourceObjectFlags = ts.getObjectFlags(source);
|
|
53985
54102
|
var targetObjectFlags = ts.getObjectFlags(target);
|
|
53986
|
-
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) {
|
|
53987
54105
|
for (var i = 0; i < targetSignatures.length; i++) {
|
|
53988
54106
|
var related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i]));
|
|
53989
54107
|
if (!related) {
|
|
@@ -54864,9 +54982,12 @@ var ts;
|
|
|
54864
54982
|
&& ((target.flags & (8 | 4 | 16)) !== 0);
|
|
54865
54983
|
}
|
|
54866
54984
|
function isObjectTypeWithInferableIndex(type) {
|
|
54867
|
-
return type.flags & 2097152
|
|
54868
|
-
|
|
54869
|
-
|
|
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));
|
|
54870
54991
|
}
|
|
54871
54992
|
function createSymbolWithType(source, type) {
|
|
54872
54993
|
var symbol = createSymbol(source.flags, source.escapedName, ts.getCheckFlags(source) & 8);
|
|
@@ -56269,7 +56390,8 @@ var ts;
|
|
|
56269
56390
|
return access.kind === 205 ? access.name.escapedText :
|
|
56270
56391
|
access.kind === 206 && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
|
|
56271
56392
|
access.kind === 202 && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
|
|
56272
|
-
|
|
56393
|
+
access.kind === 163 ? ("" + access.parent.parameters.indexOf(access)) :
|
|
56394
|
+
undefined;
|
|
56273
56395
|
}
|
|
56274
56396
|
function containsMatchingReference(source, target) {
|
|
56275
56397
|
while (ts.isAccessExpression(source)) {
|
|
@@ -57470,11 +57592,11 @@ var ts;
|
|
|
57470
57592
|
return result;
|
|
57471
57593
|
}
|
|
57472
57594
|
function getCandidateDiscriminantPropertyAccess(expr) {
|
|
57473
|
-
if (ts.isBindingPattern(reference)) {
|
|
57595
|
+
if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
|
|
57474
57596
|
if (ts.isIdentifier(expr)) {
|
|
57475
57597
|
var symbol = getResolvedSymbol(expr);
|
|
57476
57598
|
var declaration = symbol.valueDeclaration;
|
|
57477
|
-
if (declaration && ts.isBindingElement(declaration) &&
|
|
57599
|
+
if (declaration && (ts.isBindingElement(declaration) || ts.isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
57478
57600
|
return declaration;
|
|
57479
57601
|
}
|
|
57480
57602
|
}
|
|
@@ -58159,18 +58281,34 @@ var ts;
|
|
|
58159
58281
|
}
|
|
58160
58282
|
function getNarrowedTypeOfSymbol(symbol, location) {
|
|
58161
58283
|
var declaration = symbol.valueDeclaration;
|
|
58162
|
-
if (declaration
|
|
58163
|
-
|
|
58164
|
-
|
|
58165
|
-
|
|
58166
|
-
|
|
58167
|
-
links.flags
|
|
58168
|
-
|
|
58169
|
-
|
|
58170
|
-
|
|
58171
|
-
|
|
58172
|
-
|
|
58173
|
-
|
|
58284
|
+
if (declaration) {
|
|
58285
|
+
if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
58286
|
+
var parent = declaration.parent.parent;
|
|
58287
|
+
if (parent.kind === 253 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 163) {
|
|
58288
|
+
var links = getNodeLinks(location);
|
|
58289
|
+
if (!(links.flags & 268435456)) {
|
|
58290
|
+
links.flags |= 268435456;
|
|
58291
|
+
var parentType = getTypeForBindingElementParent(parent);
|
|
58292
|
+
links.flags &= ~268435456;
|
|
58293
|
+
if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
|
|
58294
|
+
var pattern = declaration.parent;
|
|
58295
|
+
var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, undefined, location.flowNode);
|
|
58296
|
+
return getBindingElementTypeFromParentType(declaration, narrowedType);
|
|
58297
|
+
}
|
|
58298
|
+
}
|
|
58299
|
+
}
|
|
58300
|
+
}
|
|
58301
|
+
if (ts.isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
58302
|
+
var func = declaration.parent;
|
|
58303
|
+
if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
|
|
58304
|
+
var contextualSignature = getContextualSignature(func);
|
|
58305
|
+
if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
|
|
58306
|
+
var restType = getTypeOfSymbol(contextualSignature.parameters[0]);
|
|
58307
|
+
if (restType.flags & 1048576 && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
|
|
58308
|
+
var narrowedType = getFlowTypeOfReference(func, restType, restType, undefined, location.flowNode);
|
|
58309
|
+
var index = func.parameters.indexOf(declaration) - (ts.getThisParameter(func) ? 1 : 0);
|
|
58310
|
+
return getIndexedAccessType(narrowedType, getNumberLiteralType(index));
|
|
58311
|
+
}
|
|
58174
58312
|
}
|
|
58175
58313
|
}
|
|
58176
58314
|
}
|
|
@@ -59116,7 +59254,7 @@ var ts;
|
|
|
59116
59254
|
}
|
|
59117
59255
|
if (isTupleType(t)) {
|
|
59118
59256
|
var restType = getRestTypeOfTupleType(t);
|
|
59119
|
-
if (restType && isNumericLiteralName(name) && +name >= 0) {
|
|
59257
|
+
if (restType && ts.isNumericLiteralName(name) && +name >= 0) {
|
|
59120
59258
|
return restType;
|
|
59121
59259
|
}
|
|
59122
59260
|
}
|
|
@@ -59659,10 +59797,10 @@ var ts;
|
|
|
59659
59797
|
case 161:
|
|
59660
59798
|
return isNumericComputedName(name);
|
|
59661
59799
|
case 79:
|
|
59662
|
-
return isNumericLiteralName(name.escapedText);
|
|
59800
|
+
return ts.isNumericLiteralName(name.escapedText);
|
|
59663
59801
|
case 8:
|
|
59664
59802
|
case 10:
|
|
59665
|
-
return isNumericLiteralName(name.text);
|
|
59803
|
+
return ts.isNumericLiteralName(name.text);
|
|
59666
59804
|
default:
|
|
59667
59805
|
return false;
|
|
59668
59806
|
}
|
|
@@ -59670,9 +59808,6 @@ var ts;
|
|
|
59670
59808
|
function isNumericComputedName(name) {
|
|
59671
59809
|
return isTypeAssignableToKind(checkComputedPropertyName(name), 296);
|
|
59672
59810
|
}
|
|
59673
|
-
function isNumericLiteralName(name) {
|
|
59674
|
-
return (+name).toString() === name;
|
|
59675
|
-
}
|
|
59676
59811
|
function checkComputedPropertyName(node) {
|
|
59677
59812
|
var links = getNodeLinks(node.expression);
|
|
59678
59813
|
if (!links.resolvedType) {
|
|
@@ -59701,7 +59836,7 @@ var ts;
|
|
|
59701
59836
|
function isSymbolWithNumericName(symbol) {
|
|
59702
59837
|
var _a;
|
|
59703
59838
|
var firstDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0];
|
|
59704
|
-
return isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
|
|
59839
|
+
return ts.isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
|
|
59705
59840
|
}
|
|
59706
59841
|
function isSymbolWithSymbolName(symbol) {
|
|
59707
59842
|
var _a;
|
|
@@ -60738,6 +60873,9 @@ var ts;
|
|
|
60738
60873
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
60739
60874
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
60740
60875
|
}
|
|
60876
|
+
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 134217728) {
|
|
60877
|
+
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
60878
|
+
}
|
|
60741
60879
|
}
|
|
60742
60880
|
else {
|
|
60743
60881
|
if (prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 && isUncalledFunctionReference(node, prop)) {
|
|
@@ -69014,7 +69152,7 @@ var ts;
|
|
|
69014
69152
|
}
|
|
69015
69153
|
else {
|
|
69016
69154
|
var text = ts.getTextOfPropertyName(member.name);
|
|
69017
|
-
if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
|
|
69155
|
+
if (ts.isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
|
|
69018
69156
|
error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
|
|
69019
69157
|
}
|
|
69020
69158
|
}
|
|
@@ -69733,9 +69871,9 @@ var ts;
|
|
|
69733
69871
|
error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
|
|
69734
69872
|
}
|
|
69735
69873
|
}
|
|
69736
|
-
var
|
|
69737
|
-
if (
|
|
69738
|
-
|
|
69874
|
+
var exports_3 = getExportsOfModule(moduleSymbol);
|
|
69875
|
+
if (exports_3) {
|
|
69876
|
+
exports_3.forEach(function (_a, id) {
|
|
69739
69877
|
var declarations = _a.declarations, flags = _a.flags;
|
|
69740
69878
|
if (id === "__export") {
|
|
69741
69879
|
return;
|
|
@@ -77458,6 +77596,8 @@ var ts;
|
|
|
77458
77596
|
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
|
|
77459
77597
|
ts.setCommentRange(statement, property);
|
|
77460
77598
|
ts.setOriginalNode(statement, property);
|
|
77599
|
+
ts.setSyntheticLeadingComments(expression, undefined);
|
|
77600
|
+
ts.setSyntheticTrailingComments(expression, undefined);
|
|
77461
77601
|
statements.push(statement);
|
|
77462
77602
|
}
|
|
77463
77603
|
}
|
|
@@ -89528,7 +89668,7 @@ var ts;
|
|
|
89528
89668
|
emitPlaceholder(hint, node, snippet);
|
|
89529
89669
|
break;
|
|
89530
89670
|
case 0:
|
|
89531
|
-
emitTabStop(snippet);
|
|
89671
|
+
emitTabStop(hint, node, snippet);
|
|
89532
89672
|
break;
|
|
89533
89673
|
}
|
|
89534
89674
|
}
|
|
@@ -89537,7 +89677,9 @@ var ts;
|
|
|
89537
89677
|
pipelineEmitWithHintWorker(hint, node, false);
|
|
89538
89678
|
nonEscapingWrite("}");
|
|
89539
89679
|
}
|
|
89540
|
-
function emitTabStop(snippet) {
|
|
89680
|
+
function emitTabStop(hint, node, snippet) {
|
|
89681
|
+
ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
|
|
89682
|
+
ts.Debug.assert(hint !== 5, "A tab stop cannot be attached to an embedded statement.");
|
|
89541
89683
|
nonEscapingWrite("$" + snippet.order);
|
|
89542
89684
|
}
|
|
89543
89685
|
function emitIdentifier(node) {
|
|
@@ -98402,27 +98544,27 @@ var ts;
|
|
|
98402
98544
|
useCaseSensitiveFileNames: (_a = host.useCaseSensitiveFileNames) === null || _a === void 0 ? void 0 : _a.call(host),
|
|
98403
98545
|
};
|
|
98404
98546
|
}
|
|
98405
|
-
function updateModuleSpecifier(compilerOptions, importingSourceFileName, toFileName, host, oldImportSpecifier) {
|
|
98406
|
-
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), {});
|
|
98407
98549
|
if (res === oldImportSpecifier)
|
|
98408
98550
|
return undefined;
|
|
98409
98551
|
return res;
|
|
98410
98552
|
}
|
|
98411
98553
|
moduleSpecifiers_1.updateModuleSpecifier = updateModuleSpecifier;
|
|
98412
98554
|
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host) {
|
|
98413
|
-
return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
|
|
98555
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
|
|
98414
98556
|
}
|
|
98415
98557
|
moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier;
|
|
98416
|
-
function getNodeModulesPackageName(compilerOptions,
|
|
98417
|
-
var info = getInfo(
|
|
98418
|
-
var modulePaths = getAllModulePaths(
|
|
98419
|
-
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); });
|
|
98420
98562
|
}
|
|
98421
98563
|
moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
|
|
98422
|
-
function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences, userPreferences) {
|
|
98564
|
+
function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences) {
|
|
98423
98565
|
var info = getInfo(importingSourceFileName, host);
|
|
98424
98566
|
var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences);
|
|
98425
|
-
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); }) ||
|
|
98426
98568
|
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
|
|
98427
98569
|
}
|
|
98428
98570
|
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences) {
|
|
@@ -98481,7 +98623,7 @@ var ts;
|
|
|
98481
98623
|
var relativeSpecifiers;
|
|
98482
98624
|
for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {
|
|
98483
98625
|
var modulePath = modulePaths_1[_i];
|
|
98484
|
-
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions);
|
|
98626
|
+
var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions);
|
|
98485
98627
|
nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);
|
|
98486
98628
|
if (specifier && modulePath.isRedirect) {
|
|
98487
98629
|
return nodeModulesSpecifiers;
|
|
@@ -98811,7 +98953,7 @@ var ts;
|
|
|
98811
98953
|
? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
|
|
98812
98954
|
: ts.removeFileExtension(relativePath);
|
|
98813
98955
|
}
|
|
98814
|
-
function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) {
|
|
98956
|
+
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly) {
|
|
98815
98957
|
var path = _a.path, isRedirect = _a.isRedirect;
|
|
98816
98958
|
var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;
|
|
98817
98959
|
if (!host.fileExists || !host.readFile) {
|
|
@@ -98868,9 +99010,14 @@ var ts;
|
|
|
98868
99010
|
if (host.fileExists(packageJsonPath)) {
|
|
98869
99011
|
var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));
|
|
98870
99012
|
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
98871
|
-
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;
|
|
98872
99017
|
if (fromExports) {
|
|
98873
|
-
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) };
|
|
98874
99021
|
return __assign(__assign({}, withJsExtension), { verbatimFromExports: true });
|
|
98875
99022
|
}
|
|
98876
99023
|
if (packageJsonContent.exports) {
|
|
@@ -98962,7 +99109,7 @@ var ts;
|
|
|
98962
99109
|
function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
|
|
98963
99110
|
return ts.firstDefined(rootDirs, function (rootDir) {
|
|
98964
99111
|
var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
|
|
98965
|
-
return isPathRelativeToParent(relativePath) ? undefined : relativePath;
|
|
99112
|
+
return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
|
|
98966
99113
|
});
|
|
98967
99114
|
}
|
|
98968
99115
|
function removeExtensionAndIndexPostFix(fileName, ending, options) {
|
|
@@ -99128,7 +99275,7 @@ var ts;
|
|
|
99128
99275
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99129
99276
|
}
|
|
99130
99277
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99131
|
-
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
99278
|
+
function getErrorSummaryText(errorCount, filesInError, newLine, host) {
|
|
99132
99279
|
if (errorCount === 0)
|
|
99133
99280
|
return "";
|
|
99134
99281
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
@@ -99143,10 +99290,10 @@ var ts;
|
|
|
99143
99290
|
distinctFileNamesWithLines.length === 1 ?
|
|
99144
99291
|
ts.Diagnostics.Found_0_errors_in_1_file :
|
|
99145
99292
|
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
99146
|
-
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) : "");
|
|
99147
99294
|
}
|
|
99148
99295
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99149
|
-
function createTabularErrorsDisplay(filesInError) {
|
|
99296
|
+
function createTabularErrorsDisplay(filesInError, host) {
|
|
99150
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); }); });
|
|
99151
99298
|
if (distinctFiles.length === 0)
|
|
99152
99299
|
return "";
|
|
@@ -99165,7 +99312,8 @@ var ts;
|
|
|
99165
99312
|
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
99166
99313
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99167
99314
|
: "";
|
|
99168
|
-
|
|
99315
|
+
var relativePath = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), file.fileName, false);
|
|
99316
|
+
tabularData += "" + leftPadding + errorCount + " " + relativePath + ":" + file.line + "\n";
|
|
99169
99317
|
});
|
|
99170
99318
|
return tabularData;
|
|
99171
99319
|
}
|
|
@@ -99547,7 +99695,7 @@ var ts;
|
|
|
99547
99695
|
var system = input.system || ts.sys;
|
|
99548
99696
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
99549
99697
|
var builderProgram = ts.createIncrementalProgram(input);
|
|
99550
|
-
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);
|
|
99551
99699
|
if (input.afterProgramEmitAndDiagnostics)
|
|
99552
99700
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
99553
99701
|
return exitStatus;
|
|
@@ -102257,7 +102405,7 @@ var ts;
|
|
|
102257
102405
|
}
|
|
102258
102406
|
function createReportErrorSummary(sys, options) {
|
|
102259
102407
|
return shouldBePretty(sys, options) ?
|
|
102260
|
-
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)); } :
|
|
102261
102409
|
undefined;
|
|
102262
102410
|
}
|
|
102263
102411
|
function performCompilation(sys, cb, reportDiagnostic, config) {
|