typescript 4.9.0-dev.20220901 → 4.9.0-dev.20220902

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 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.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220901");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220902");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -36780,7 +36780,7 @@ var ts;
36780
36780
  var _a, _b;
36781
36781
  if (path === undefined)
36782
36782
  return path;
36783
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
36783
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
36784
36784
  }
36785
36785
  function combineDirectoryPath(root, dir) {
36786
36786
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -36795,7 +36795,7 @@ var ts;
36795
36795
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
36796
36796
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
36797
36797
  && finalPath.indexOf("/node_modules/") === -1
36798
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
36798
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
36799
36799
  var getCanonicalFileName = ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames });
36800
36800
  var commonSourceDirGuesses = [];
36801
36801
  if (state.compilerOptions.rootDir || (state.compilerOptions.composite && state.compilerOptions.configFilePath)) {
@@ -36825,7 +36825,7 @@ var ts;
36825
36825
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
36826
36826
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
36827
36827
  var candidateDir = candidateDirectories_1[_e];
36828
- if (ts.startsWith(finalPath, candidateDir)) {
36828
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
36829
36829
  var pathFragment = finalPath.slice(candidateDir.length + 1);
36830
36830
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
36831
36831
  var jsAndDtsExtensions = [".mjs", ".cjs", ".js", ".json", ".d.mts", ".d.cts", ".d.ts"];
@@ -51995,7 +51995,7 @@ var ts;
51995
51995
  return includes & 8388608 ? wildcardType : anyType;
51996
51996
  }
51997
51997
  if (!strictNullChecks && includes & 98304) {
51998
- return includes & 32768 ? undefinedType : nullType;
51998
+ return includes & 16777216 ? neverType : includes & 32768 ? undefinedType : nullType;
51999
51999
  }
52000
52000
  if (includes & 4 && includes & (128 | 134217728 | 268435456) ||
52001
52001
  includes & 8 && includes & 256 ||
@@ -52630,7 +52630,7 @@ var ts;
52630
52630
  type;
52631
52631
  }
52632
52632
  function distributeIndexOverObjectType(objectType, indexType, writing) {
52633
- if (objectType.flags & 3145728) {
52633
+ if (objectType.flags & 1048576 || objectType.flags & 2097152 && !shouldDeferIndexType(objectType)) {
52634
52634
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
52635
52635
  return objectType.flags & 2097152 || writing ? getIntersectionType(types) : getUnionType(types);
52636
52636
  }
@@ -60174,7 +60174,7 @@ var ts;
60174
60174
  var narrowedPropType = narrowType(propType);
60175
60175
  return filterType(type, function (t) {
60176
60176
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
60177
- return !(narrowedPropType.flags & 131072) && isTypeComparableTo(narrowedPropType, discriminantType);
60177
+ return !(narrowedPropType.flags & 131072) && areTypesComparable(narrowedPropType, discriminantType);
60178
60178
  });
60179
60179
  }
60180
60180
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -62700,6 +62700,7 @@ var ts;
62700
62700
  }
62701
62701
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
62702
62702
  var attributes = openingLikeElement.attributes;
62703
+ var attributesType = getContextualType(attributes, 0);
62703
62704
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
62704
62705
  var attributesTable = ts.createSymbolTable();
62705
62706
  var spread = emptyJsxObjectType;
@@ -62727,6 +62728,12 @@ var ts;
62727
62728
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
62728
62729
  explicitlySpecifyChildrenAttribute = true;
62729
62730
  }
62731
+ if (attributesType) {
62732
+ var prop = getPropertyOfType(attributesType, member.escapedName);
62733
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
62734
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
62735
+ }
62736
+ }
62730
62737
  }
62731
62738
  else {
62732
62739
  ts.Debug.assert(attributeDecl.kind === 289);
package/lib/tsserver.js CHANGED
@@ -109,7 +109,7 @@ var ts;
109
109
  // The following is baselined as a literal template type without intervention
110
110
  /** The version of the TypeScript compiler release */
111
111
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
112
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220901");
112
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220902");
113
113
  /* @internal */
114
114
  var Comparison;
115
115
  (function (Comparison) {
@@ -44881,7 +44881,7 @@ var ts;
44881
44881
  var _a, _b;
44882
44882
  if (path === undefined)
44883
44883
  return path;
44884
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
44884
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
44885
44885
  }
44886
44886
  function combineDirectoryPath(root, dir) {
44887
44887
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -44901,7 +44901,7 @@ var ts;
44901
44901
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
44902
44902
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
44903
44903
  && finalPath.indexOf("/node_modules/") === -1
44904
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
44904
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
44905
44905
  // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
44906
44906
  // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
44907
44907
  // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
@@ -44957,7 +44957,7 @@ var ts;
44957
44957
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
44958
44958
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
44959
44959
  var candidateDir = candidateDirectories_1[_e];
44960
- if (ts.startsWith(finalPath, candidateDir)) {
44960
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
44961
44961
  // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
44962
44962
  var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
44963
44963
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
@@ -62527,7 +62527,7 @@ var ts;
62527
62527
  return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
62528
62528
  }
62529
62529
  if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
62530
- return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62530
+ return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62531
62531
  }
62532
62532
  if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
62533
62533
  includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
@@ -63217,7 +63217,7 @@ var ts;
63217
63217
  // (T | U)[K] -> T[K] | U[K] (reading)
63218
63218
  // (T | U)[K] -> T[K] & U[K] (writing)
63219
63219
  // (T & U)[K] -> T[K] & U[K]
63220
- if (objectType.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
63220
+ if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
63221
63221
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
63222
63222
  return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
63223
63223
  }
@@ -71919,7 +71919,7 @@ var ts;
71919
71919
  var narrowedPropType = narrowType(propType);
71920
71920
  return filterType(type, function (t) {
71921
71921
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
71922
- return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
71922
+ return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
71923
71923
  });
71924
71924
  }
71925
71925
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -74924,6 +74924,7 @@ var ts;
74924
74924
  */
74925
74925
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
74926
74926
  var attributes = openingLikeElement.attributes;
74927
+ var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
74927
74928
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
74928
74929
  var attributesTable = ts.createSymbolTable();
74929
74930
  var spread = emptyJsxObjectType;
@@ -74951,6 +74952,12 @@ var ts;
74951
74952
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
74952
74953
  explicitlySpecifyChildrenAttribute = true;
74953
74954
  }
74955
+ if (attributesType) {
74956
+ var prop = getPropertyOfType(attributesType, member.escapedName);
74957
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
74958
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
74959
+ }
74960
+ }
74954
74961
  }
74955
74962
  else {
74956
74963
  ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
@@ -108,7 +108,7 @@ var ts;
108
108
  // The following is baselined as a literal template type without intervention
109
109
  /** The version of the TypeScript compiler release */
110
110
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
111
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220901");
111
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220902");
112
112
  /* @internal */
113
113
  var Comparison;
114
114
  (function (Comparison) {
@@ -44880,7 +44880,7 @@ var ts;
44880
44880
  var _a, _b;
44881
44881
  if (path === undefined)
44882
44882
  return path;
44883
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
44883
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
44884
44884
  }
44885
44885
  function combineDirectoryPath(root, dir) {
44886
44886
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -44900,7 +44900,7 @@ var ts;
44900
44900
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
44901
44901
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
44902
44902
  && finalPath.indexOf("/node_modules/") === -1
44903
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
44903
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
44904
44904
  // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
44905
44905
  // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
44906
44906
  // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
@@ -44956,7 +44956,7 @@ var ts;
44956
44956
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
44957
44957
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
44958
44958
  var candidateDir = candidateDirectories_1[_e];
44959
- if (ts.startsWith(finalPath, candidateDir)) {
44959
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
44960
44960
  // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
44961
44961
  var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
44962
44962
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
@@ -62526,7 +62526,7 @@ var ts;
62526
62526
  return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
62527
62527
  }
62528
62528
  if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
62529
- return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62529
+ return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62530
62530
  }
62531
62531
  if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
62532
62532
  includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
@@ -63216,7 +63216,7 @@ var ts;
63216
63216
  // (T | U)[K] -> T[K] | U[K] (reading)
63217
63217
  // (T | U)[K] -> T[K] & U[K] (writing)
63218
63218
  // (T & U)[K] -> T[K] & U[K]
63219
- if (objectType.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
63219
+ if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
63220
63220
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
63221
63221
  return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
63222
63222
  }
@@ -71918,7 +71918,7 @@ var ts;
71918
71918
  var narrowedPropType = narrowType(propType);
71919
71919
  return filterType(type, function (t) {
71920
71920
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
71921
- return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
71921
+ return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
71922
71922
  });
71923
71923
  }
71924
71924
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -74923,6 +74923,7 @@ var ts;
74923
74923
  */
74924
74924
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
74925
74925
  var attributes = openingLikeElement.attributes;
74926
+ var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
74926
74927
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
74927
74928
  var attributesTable = ts.createSymbolTable();
74928
74929
  var spread = emptyJsxObjectType;
@@ -74950,6 +74951,12 @@ var ts;
74950
74951
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
74951
74952
  explicitlySpecifyChildrenAttribute = true;
74952
74953
  }
74954
+ if (attributesType) {
74955
+ var prop = getPropertyOfType(attributesType, member.escapedName);
74956
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
74957
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
74958
+ }
74959
+ }
74953
74960
  }
74954
74961
  else {
74955
74962
  ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
package/lib/typescript.js CHANGED
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220901");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220902");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -44871,7 +44871,7 @@ var ts;
44871
44871
  var _a, _b;
44872
44872
  if (path === undefined)
44873
44873
  return path;
44874
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
44874
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
44875
44875
  }
44876
44876
  function combineDirectoryPath(root, dir) {
44877
44877
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -44891,7 +44891,7 @@ var ts;
44891
44891
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
44892
44892
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
44893
44893
  && finalPath.indexOf("/node_modules/") === -1
44894
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
44894
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
44895
44895
  // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
44896
44896
  // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
44897
44897
  // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
@@ -44947,7 +44947,7 @@ var ts;
44947
44947
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
44948
44948
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
44949
44949
  var candidateDir = candidateDirectories_1[_e];
44950
- if (ts.startsWith(finalPath, candidateDir)) {
44950
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
44951
44951
  // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
44952
44952
  var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
44953
44953
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
@@ -62517,7 +62517,7 @@ var ts;
62517
62517
  return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
62518
62518
  }
62519
62519
  if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
62520
- return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62520
+ return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62521
62521
  }
62522
62522
  if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
62523
62523
  includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
@@ -63207,7 +63207,7 @@ var ts;
63207
63207
  // (T | U)[K] -> T[K] | U[K] (reading)
63208
63208
  // (T | U)[K] -> T[K] & U[K] (writing)
63209
63209
  // (T & U)[K] -> T[K] & U[K]
63210
- if (objectType.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
63210
+ if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
63211
63211
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
63212
63212
  return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
63213
63213
  }
@@ -71909,7 +71909,7 @@ var ts;
71909
71909
  var narrowedPropType = narrowType(propType);
71910
71910
  return filterType(type, function (t) {
71911
71911
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
71912
- return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
71912
+ return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
71913
71913
  });
71914
71914
  }
71915
71915
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -74914,6 +74914,7 @@ var ts;
74914
74914
  */
74915
74915
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
74916
74916
  var attributes = openingLikeElement.attributes;
74917
+ var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
74917
74918
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
74918
74919
  var attributesTable = ts.createSymbolTable();
74919
74920
  var spread = emptyJsxObjectType;
@@ -74941,6 +74942,12 @@ var ts;
74941
74942
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
74942
74943
  explicitlySpecifyChildrenAttribute = true;
74943
74944
  }
74945
+ if (attributesType) {
74946
+ var prop = getPropertyOfType(attributesType, member.escapedName);
74947
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
74948
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
74949
+ }
74950
+ }
74944
74951
  }
74945
74952
  else {
74946
74953
  ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220901");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220902");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -44871,7 +44871,7 @@ var ts;
44871
44871
  var _a, _b;
44872
44872
  if (path === undefined)
44873
44873
  return path;
44874
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
44874
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
44875
44875
  }
44876
44876
  function combineDirectoryPath(root, dir) {
44877
44877
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -44891,7 +44891,7 @@ var ts;
44891
44891
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
44892
44892
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
44893
44893
  && finalPath.indexOf("/node_modules/") === -1
44894
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
44894
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
44895
44895
  // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
44896
44896
  // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
44897
44897
  // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
@@ -44947,7 +44947,7 @@ var ts;
44947
44947
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
44948
44948
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
44949
44949
  var candidateDir = candidateDirectories_1[_e];
44950
- if (ts.startsWith(finalPath, candidateDir)) {
44950
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
44951
44951
  // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
44952
44952
  var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
44953
44953
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
@@ -62517,7 +62517,7 @@ var ts;
62517
62517
  return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
62518
62518
  }
62519
62519
  if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
62520
- return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62520
+ return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62521
62521
  }
62522
62522
  if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
62523
62523
  includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
@@ -63207,7 +63207,7 @@ var ts;
63207
63207
  // (T | U)[K] -> T[K] | U[K] (reading)
63208
63208
  // (T | U)[K] -> T[K] & U[K] (writing)
63209
63209
  // (T & U)[K] -> T[K] & U[K]
63210
- if (objectType.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
63210
+ if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
63211
63211
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
63212
63212
  return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
63213
63213
  }
@@ -71909,7 +71909,7 @@ var ts;
71909
71909
  var narrowedPropType = narrowType(propType);
71910
71910
  return filterType(type, function (t) {
71911
71911
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
71912
- return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
71912
+ return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
71913
71913
  });
71914
71914
  }
71915
71915
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -74914,6 +74914,7 @@ var ts;
74914
74914
  */
74915
74915
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
74916
74916
  var attributes = openingLikeElement.attributes;
74917
+ var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
74917
74918
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
74918
74919
  var attributesTable = ts.createSymbolTable();
74919
74920
  var spread = emptyJsxObjectType;
@@ -74941,6 +74942,12 @@ var ts;
74941
74942
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
74942
74943
  explicitlySpecifyChildrenAttribute = true;
74943
74944
  }
74945
+ if (attributesType) {
74946
+ var prop = getPropertyOfType(attributesType, member.escapedName);
74947
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
74948
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
74949
+ }
74950
+ }
74944
74951
  }
74945
74952
  else {
74946
74953
  ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220901");
92
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220902");
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -44861,7 +44861,7 @@ var ts;
44861
44861
  var _a, _b;
44862
44862
  if (path === undefined)
44863
44863
  return path;
44864
- return ts.hostGetCanonicalFileName({ useCaseSensitiveFileNames: useCaseSensitiveFileNames })(ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a)));
44864
+ return ts.getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
44865
44865
  }
44866
44866
  function combineDirectoryPath(root, dir) {
44867
44867
  return ts.ensureTrailingDirectorySeparator(ts.combinePaths(root, dir));
@@ -44881,7 +44881,7 @@ var ts;
44881
44881
  if ((extensions === Extensions.TypeScript || extensions === Extensions.JavaScript || extensions === Extensions.Json)
44882
44882
  && (state.compilerOptions.declarationDir || state.compilerOptions.outDir)
44883
44883
  && finalPath.indexOf("/node_modules/") === -1
44884
- && (state.compilerOptions.configFile ? ts.startsWith(toAbsolutePath(state.compilerOptions.configFile.fileName), scope.packageDirectory) : true)) {
44884
+ && (state.compilerOptions.configFile ? ts.containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames()) : true)) {
44885
44885
  // So that all means we'll only try these guesses for files outside `node_modules` in a directory where the `package.json` and `tsconfig.json` are siblings.
44886
44886
  // Even with all that, we still don't know if the root of the output file structure will be (relative to the package file)
44887
44887
  // `.`, `./src` or any other deeper directory structure. (If project references are used, it's definitely `.` by fiat, so that should be pretty common.)
@@ -44937,7 +44937,7 @@ var ts;
44937
44937
  var candidateDirectories = getOutputDirectoriesForBaseDirectory(commonSourceDirGuess);
44938
44938
  for (var _e = 0, candidateDirectories_1 = candidateDirectories; _e < candidateDirectories_1.length; _e++) {
44939
44939
  var candidateDir = candidateDirectories_1[_e];
44940
- if (ts.startsWith(finalPath, candidateDir)) {
44940
+ if (ts.containsPath(candidateDir, finalPath, !useCaseSensitiveFileNames())) {
44941
44941
  // The matched export is looking up something in either the out declaration or js dir, now map the written path back into the source dir and source extension
44942
44942
  var pathFragment = finalPath.slice(candidateDir.length + 1); // +1 to also remove directory seperator
44943
44943
  var possibleInputBase = ts.combinePaths(commonSourceDirGuess, pathFragment);
@@ -62507,7 +62507,7 @@ var ts;
62507
62507
  return includes & 8388608 /* TypeFlags.IncludesWildcard */ ? wildcardType : anyType;
62508
62508
  }
62509
62509
  if (!strictNullChecks && includes & 98304 /* TypeFlags.Nullable */) {
62510
- return includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62510
+ return includes & 16777216 /* TypeFlags.IncludesEmptyObject */ ? neverType : includes & 32768 /* TypeFlags.Undefined */ ? undefinedType : nullType;
62511
62511
  }
62512
62512
  if (includes & 4 /* TypeFlags.String */ && includes & (128 /* TypeFlags.StringLiteral */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */) ||
62513
62513
  includes & 8 /* TypeFlags.Number */ && includes & 256 /* TypeFlags.NumberLiteral */ ||
@@ -63197,7 +63197,7 @@ var ts;
63197
63197
  // (T | U)[K] -> T[K] | U[K] (reading)
63198
63198
  // (T | U)[K] -> T[K] & U[K] (writing)
63199
63199
  // (T & U)[K] -> T[K] & U[K]
63200
- if (objectType.flags & 3145728 /* TypeFlags.UnionOrIntersection */) {
63200
+ if (objectType.flags & 1048576 /* TypeFlags.Union */ || objectType.flags & 2097152 /* TypeFlags.Intersection */ && !shouldDeferIndexType(objectType)) {
63201
63201
  var types = ts.map(objectType.types, function (t) { return getSimplifiedType(getIndexedAccessType(t, indexType), writing); });
63202
63202
  return objectType.flags & 2097152 /* TypeFlags.Intersection */ || writing ? getIntersectionType(types) : getUnionType(types);
63203
63203
  }
@@ -71899,7 +71899,7 @@ var ts;
71899
71899
  var narrowedPropType = narrowType(propType);
71900
71900
  return filterType(type, function (t) {
71901
71901
  var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
71902
- return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && isTypeComparableTo(narrowedPropType, discriminantType);
71902
+ return !(narrowedPropType.flags & 131072 /* TypeFlags.Never */) && areTypesComparable(narrowedPropType, discriminantType);
71903
71903
  });
71904
71904
  }
71905
71905
  function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
@@ -74904,6 +74904,7 @@ var ts;
74904
74904
  */
74905
74905
  function createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode) {
74906
74906
  var attributes = openingLikeElement.attributes;
74907
+ var attributesType = getContextualType(attributes, 0 /* ContextFlags.None */);
74907
74908
  var allAttributesTable = strictNullChecks ? ts.createSymbolTable() : undefined;
74908
74909
  var attributesTable = ts.createSymbolTable();
74909
74910
  var spread = emptyJsxObjectType;
@@ -74931,6 +74932,12 @@ var ts;
74931
74932
  if (attributeDecl.name.escapedText === jsxChildrenPropertyName) {
74932
74933
  explicitlySpecifyChildrenAttribute = true;
74933
74934
  }
74935
+ if (attributesType) {
74936
+ var prop = getPropertyOfType(attributesType, member.escapedName);
74937
+ if (prop && prop.declarations && isDeprecatedSymbol(prop)) {
74938
+ addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
74939
+ }
74940
+ }
74934
74941
  }
74935
74942
  else {
74936
74943
  ts.Debug.assert(attributeDecl.kind === 289 /* SyntaxKind.JsxSpreadAttribute */);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.9.0-dev.20220901",
5
+ "version": "4.9.0-dev.20220902",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [