typescript 5.1.0-dev.20230406 → 5.1.0-dev.20230407

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.1";
21
- var version = `${versionMajorMinor}.0-dev.20230406`;
21
+ var version = `${versionMajorMinor}.0-dev.20230407`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -16595,6 +16595,7 @@ var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts
16595
16595
  var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
16596
16596
  var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
16597
16597
  var supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
16598
+ var extensionsNotSupportingExtensionlessResolution = [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */];
16598
16599
  function getSupportedExtensions(options, extraFileExtensions) {
16599
16600
  const needJsExtensions = options && getAllowJSCompilerOption(options);
16600
16601
  if (!extraFileExtensions || extraFileExtensions.length === 0) {
@@ -16627,7 +16628,7 @@ function hasTSFileExtension(fileName) {
16627
16628
  return some(supportedTSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension));
16628
16629
  }
16629
16630
  function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtension, hasTSFileExtension)) {
16630
- return firstDefined(imports, ({ text }) => pathIsRelative(text) ? hasExtension2(text) : void 0) || false;
16631
+ return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false;
16631
16632
  }
16632
16633
  function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
16633
16634
  if (preference === "js" || resolutionMode === 99 /* ESNext */) {
@@ -16651,6 +16652,9 @@ function getModuleSpecifierEndingPreference(preference, resolutionMode, compiler
16651
16652
  const specifiers = sourceFile.imports.length ? sourceFile.imports.map((i) => i.text) : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0].text) : emptyArray;
16652
16653
  for (const specifier of specifiers) {
16653
16654
  if (pathIsRelative(specifier)) {
16655
+ if (fileExtensionIsOneOf(specifier, extensionsNotSupportingExtensionlessResolution)) {
16656
+ continue;
16657
+ }
16654
16658
  if (hasTSFileExtension(specifier)) {
16655
16659
  return 3 /* TsExtension */;
16656
16660
  }
@@ -41720,7 +41724,7 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
41720
41724
  return [2 /* JsExtension */];
41721
41725
  }
41722
41726
  if (getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */) {
41723
- return [1 /* Index */, 2 /* JsExtension */];
41727
+ return preferredEnding === 2 /* JsExtension */ ? [2 /* JsExtension */, 1 /* Index */] : [1 /* Index */, 2 /* JsExtension */];
41724
41728
  }
41725
41729
  switch (preferredEnding) {
41726
41730
  case 2 /* JsExtension */:
@@ -72641,7 +72645,7 @@ function createTypeChecker(host) {
72641
72645
  }
72642
72646
  return getUnaryResultType(operandType);
72643
72647
  case 53 /* ExclamationToken */:
72644
- checkTruthinessExpression(node.operand);
72648
+ checkTruthinessOfType(operandType, node.operand);
72645
72649
  const facts = getTypeFacts(operandType) & (4194304 /* Truthy */ | 8388608 /* Falsy */);
72646
72650
  return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType;
72647
72651
  case 45 /* PlusPlusToken */:
package/lib/tsserver.js CHANGED
@@ -546,6 +546,7 @@ __export(server_exports, {
546
546
  extendsHelper: () => extendsHelper,
547
547
  extensionFromPath: () => extensionFromPath,
548
548
  extensionIsTS: () => extensionIsTS,
549
+ extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution,
549
550
  externalHelpersModuleNameText: () => externalHelpersModuleNameText,
550
551
  factory: () => factory,
551
552
  fileExtensionIs: () => fileExtensionIs,
@@ -2292,7 +2293,7 @@ module.exports = __toCommonJS(server_exports);
2292
2293
 
2293
2294
  // src/compiler/corePublic.ts
2294
2295
  var versionMajorMinor = "5.1";
2295
- var version = `${versionMajorMinor}.0-dev.20230406`;
2296
+ var version = `${versionMajorMinor}.0-dev.20230407`;
2296
2297
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2297
2298
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2298
2299
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -20739,6 +20740,7 @@ var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts
20739
20740
  var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
20740
20741
  var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
20741
20742
  var supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
20743
+ var extensionsNotSupportingExtensionlessResolution = [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */];
20742
20744
  function getSupportedExtensions(options, extraFileExtensions) {
20743
20745
  const needJsExtensions = options && getAllowJSCompilerOption(options);
20744
20746
  if (!extraFileExtensions || extraFileExtensions.length === 0) {
@@ -20778,7 +20780,7 @@ var ModuleSpecifierEnding = /* @__PURE__ */ ((ModuleSpecifierEnding2) => {
20778
20780
  return ModuleSpecifierEnding2;
20779
20781
  })(ModuleSpecifierEnding || {});
20780
20782
  function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtension, hasTSFileExtension)) {
20781
- return firstDefined(imports, ({ text }) => pathIsRelative(text) ? hasExtension2(text) : void 0) || false;
20783
+ return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false;
20782
20784
  }
20783
20785
  function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
20784
20786
  if (preference === "js" || resolutionMode === 99 /* ESNext */) {
@@ -20802,6 +20804,9 @@ function getModuleSpecifierEndingPreference(preference, resolutionMode, compiler
20802
20804
  const specifiers = sourceFile.imports.length ? sourceFile.imports.map((i) => i.text) : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0].text) : emptyArray;
20803
20805
  for (const specifier of specifiers) {
20804
20806
  if (pathIsRelative(specifier)) {
20807
+ if (fileExtensionIsOneOf(specifier, extensionsNotSupportingExtensionlessResolution)) {
20808
+ continue;
20809
+ }
20805
20810
  if (hasTSFileExtension(specifier)) {
20806
20811
  return 3 /* TsExtension */;
20807
20812
  }
@@ -46335,7 +46340,7 @@ function getPreferences({ importModuleSpecifierPreference, importModuleSpecifier
46335
46340
  return [2 /* JsExtension */];
46336
46341
  }
46337
46342
  if (getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */) {
46338
- return [1 /* Index */, 2 /* JsExtension */];
46343
+ return preferredEnding === 2 /* JsExtension */ ? [2 /* JsExtension */, 1 /* Index */] : [1 /* Index */, 2 /* JsExtension */];
46339
46344
  }
46340
46345
  switch (preferredEnding) {
46341
46346
  case 2 /* JsExtension */:
@@ -77289,7 +77294,7 @@ function createTypeChecker(host) {
77289
77294
  }
77290
77295
  return getUnaryResultType(operandType);
77291
77296
  case 53 /* ExclamationToken */:
77292
- checkTruthinessExpression(node.operand);
77297
+ checkTruthinessOfType(operandType, node.operand);
77293
77298
  const facts = getTypeFacts(operandType) & (4194304 /* Truthy */ | 8388608 /* Falsy */);
77294
77299
  return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType;
77295
77300
  case 45 /* PlusPlusToken */:
@@ -169156,6 +169161,7 @@ __export(ts_exports2, {
169156
169161
  extendsHelper: () => extendsHelper,
169157
169162
  extensionFromPath: () => extensionFromPath,
169158
169163
  extensionIsTS: () => extensionIsTS,
169164
+ extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution,
169159
169165
  externalHelpersModuleNameText: () => externalHelpersModuleNameText,
169160
169166
  factory: () => factory,
169161
169167
  fileExtensionIs: () => fileExtensionIs,
@@ -183128,6 +183134,7 @@ start(initializeNodeSystem(), require("os").platform());
183128
183134
  extendsHelper,
183129
183135
  extensionFromPath,
183130
183136
  extensionIsTS,
183137
+ extensionsNotSupportingExtensionlessResolution,
183131
183138
  externalHelpersModuleNameText,
183132
183139
  factory,
183133
183140
  fileExtensionIs,
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-dev.20230406`;
38
+ version = `${versionMajorMinor}.0-dev.20230407`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -18444,7 +18444,7 @@ ${lanes.join("\n")}
18444
18444
  return some(supportedTSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension));
18445
18445
  }
18446
18446
  function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtension, hasTSFileExtension)) {
18447
- return firstDefined(imports, ({ text }) => pathIsRelative(text) ? hasExtension2(text) : void 0) || false;
18447
+ return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false;
18448
18448
  }
18449
18449
  function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
18450
18450
  if (preference === "js" || resolutionMode === 99 /* ESNext */) {
@@ -18468,6 +18468,9 @@ ${lanes.join("\n")}
18468
18468
  const specifiers = sourceFile.imports.length ? sourceFile.imports.map((i) => i.text) : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0].text) : emptyArray;
18469
18469
  for (const specifier of specifiers) {
18470
18470
  if (pathIsRelative(specifier)) {
18471
+ if (fileExtensionIsOneOf(specifier, extensionsNotSupportingExtensionlessResolution)) {
18472
+ continue;
18473
+ }
18471
18474
  if (hasTSFileExtension(specifier)) {
18472
18475
  return 3 /* TsExtension */;
18473
18476
  }
@@ -19098,7 +19101,7 @@ ${lanes.join("\n")}
19098
19101
  const tag = getJSDocSatisfiesTag(node);
19099
19102
  return tag && tag.typeExpression && tag.typeExpression.type;
19100
19103
  }
19101
- var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19104
+ var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19102
19105
  var init_utilities = __esm({
19103
19106
  "src/compiler/utilities.ts"() {
19104
19107
  "use strict";
@@ -19262,6 +19265,7 @@ ${lanes.join("\n")}
19262
19265
  allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
19263
19266
  supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
19264
19267
  supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
19268
+ extensionsNotSupportingExtensionlessResolution = [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */];
19265
19269
  ModuleSpecifierEnding = /* @__PURE__ */ ((ModuleSpecifierEnding2) => {
19266
19270
  ModuleSpecifierEnding2[ModuleSpecifierEnding2["Minimal"] = 0] = "Minimal";
19267
19271
  ModuleSpecifierEnding2[ModuleSpecifierEnding2["Index"] = 1] = "Index";
@@ -44235,7 +44239,7 @@ ${lanes.join("\n")}
44235
44239
  return [2 /* JsExtension */];
44236
44240
  }
44237
44241
  if (getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */) {
44238
- return [1 /* Index */, 2 /* JsExtension */];
44242
+ return preferredEnding === 2 /* JsExtension */ ? [2 /* JsExtension */, 1 /* Index */] : [1 /* Index */, 2 /* JsExtension */];
44239
44243
  }
44240
44244
  switch (preferredEnding) {
44241
44245
  case 2 /* JsExtension */:
@@ -75091,7 +75095,7 @@ ${lanes.join("\n")}
75091
75095
  }
75092
75096
  return getUnaryResultType(operandType);
75093
75097
  case 53 /* ExclamationToken */:
75094
- checkTruthinessExpression(node.operand);
75098
+ checkTruthinessOfType(operandType, node.operand);
75095
75099
  const facts = getTypeFacts(operandType) & (4194304 /* Truthy */ | 8388608 /* Falsy */);
75096
75100
  return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType;
75097
75101
  case 45 /* PlusPlusToken */:
@@ -179754,6 +179758,7 @@ ${e.message}`;
179754
179758
  extendsHelper: () => extendsHelper,
179755
179759
  extensionFromPath: () => extensionFromPath,
179756
179760
  extensionIsTS: () => extensionIsTS,
179761
+ extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution,
179757
179762
  externalHelpersModuleNameText: () => externalHelpersModuleNameText,
179758
179763
  factory: () => factory,
179759
179764
  fileExtensionIs: () => fileExtensionIs,
@@ -182119,6 +182124,7 @@ ${e.message}`;
182119
182124
  extendsHelper: () => extendsHelper,
182120
182125
  extensionFromPath: () => extensionFromPath,
182121
182126
  extensionIsTS: () => extensionIsTS,
182127
+ extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution,
182122
182128
  externalHelpersModuleNameText: () => externalHelpersModuleNameText,
182123
182129
  factory: () => factory,
182124
182130
  fileExtensionIs: () => fileExtensionIs,
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.1";
38
- version = `${versionMajorMinor}.0-dev.20230406`;
38
+ version = `${versionMajorMinor}.0-dev.20230407`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -18444,7 +18444,7 @@ ${lanes.join("\n")}
18444
18444
  return some(supportedTSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension));
18445
18445
  }
18446
18446
  function usesExtensionsOnImports({ imports }, hasExtension2 = or(hasJSFileExtension, hasTSFileExtension)) {
18447
- return firstDefined(imports, ({ text }) => pathIsRelative(text) ? hasExtension2(text) : void 0) || false;
18447
+ return firstDefined(imports, ({ text }) => pathIsRelative(text) && !fileExtensionIsOneOf(text, extensionsNotSupportingExtensionlessResolution) ? hasExtension2(text) : void 0) || false;
18448
18448
  }
18449
18449
  function getModuleSpecifierEndingPreference(preference, resolutionMode, compilerOptions, sourceFile) {
18450
18450
  if (preference === "js" || resolutionMode === 99 /* ESNext */) {
@@ -18468,6 +18468,9 @@ ${lanes.join("\n")}
18468
18468
  const specifiers = sourceFile.imports.length ? sourceFile.imports.map((i) => i.text) : isSourceFileJS(sourceFile) ? getRequiresAtTopOfFile(sourceFile).map((r) => r.arguments[0].text) : emptyArray;
18469
18469
  for (const specifier of specifiers) {
18470
18470
  if (pathIsRelative(specifier)) {
18471
+ if (fileExtensionIsOneOf(specifier, extensionsNotSupportingExtensionlessResolution)) {
18472
+ continue;
18473
+ }
18471
18474
  if (hasTSFileExtension(specifier)) {
18472
18475
  return 3 /* TsExtension */;
18473
18476
  }
@@ -19098,7 +19101,7 @@ ${lanes.join("\n")}
19098
19101
  const tag = getJSDocSatisfiesTag(node);
19099
19102
  return tag && tag.typeExpression && tag.typeExpression.type;
19100
19103
  }
19101
- var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19104
+ var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
19102
19105
  var init_utilities = __esm({
19103
19106
  "src/compiler/utilities.ts"() {
19104
19107
  "use strict";
@@ -19262,6 +19265,7 @@ ${lanes.join("\n")}
19262
19265
  allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
19263
19266
  supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
19264
19267
  supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
19268
+ extensionsNotSupportingExtensionlessResolution = [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */];
19265
19269
  ModuleSpecifierEnding = /* @__PURE__ */ ((ModuleSpecifierEnding2) => {
19266
19270
  ModuleSpecifierEnding2[ModuleSpecifierEnding2["Minimal"] = 0] = "Minimal";
19267
19271
  ModuleSpecifierEnding2[ModuleSpecifierEnding2["Index"] = 1] = "Index";
@@ -44235,7 +44239,7 @@ ${lanes.join("\n")}
44235
44239
  return [2 /* JsExtension */];
44236
44240
  }
44237
44241
  if (getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */) {
44238
- return [1 /* Index */, 2 /* JsExtension */];
44242
+ return preferredEnding === 2 /* JsExtension */ ? [2 /* JsExtension */, 1 /* Index */] : [1 /* Index */, 2 /* JsExtension */];
44239
44243
  }
44240
44244
  switch (preferredEnding) {
44241
44245
  case 2 /* JsExtension */:
@@ -75091,7 +75095,7 @@ ${lanes.join("\n")}
75091
75095
  }
75092
75096
  return getUnaryResultType(operandType);
75093
75097
  case 53 /* ExclamationToken */:
75094
- checkTruthinessExpression(node.operand);
75098
+ checkTruthinessOfType(operandType, node.operand);
75095
75099
  const facts = getTypeFacts(operandType) & (4194304 /* Truthy */ | 8388608 /* Falsy */);
75096
75100
  return facts === 4194304 /* Truthy */ ? falseType : facts === 8388608 /* Falsy */ ? trueType : booleanType;
75097
75101
  case 45 /* PlusPlusToken */:
@@ -168918,6 +168922,7 @@ ${options.prefix}` : "\n" : options.prefix
168918
168922
  extendsHelper: () => extendsHelper,
168919
168923
  extensionFromPath: () => extensionFromPath,
168920
168924
  extensionIsTS: () => extensionIsTS,
168925
+ extensionsNotSupportingExtensionlessResolution: () => extensionsNotSupportingExtensionlessResolution,
168921
168926
  externalHelpersModuleNameText: () => externalHelpersModuleNameText,
168922
168927
  factory: () => factory,
168923
168928
  fileExtensionIs: () => fileExtensionIs,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.1";
57
- var version = `${versionMajorMinor}.0-dev.20230406`;
57
+ var version = `${versionMajorMinor}.0-dev.20230407`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -11483,6 +11483,7 @@ var allSupportedExtensions = [[".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts
11483
11483
  var allSupportedExtensionsWithJson = [...allSupportedExtensions, [".json" /* Json */]];
11484
11484
  var supportedDeclarationExtensions = [".d.ts" /* Dts */, ".d.cts" /* Dcts */, ".d.mts" /* Dmts */];
11485
11485
  var supportedTSImplementationExtensions = [".ts" /* Ts */, ".cts" /* Cts */, ".mts" /* Mts */, ".tsx" /* Tsx */];
11486
+ var extensionsNotSupportingExtensionlessResolution = [".mts" /* Mts */, ".d.mts" /* Dmts */, ".mjs" /* Mjs */, ".cts" /* Cts */, ".d.cts" /* Dcts */, ".cjs" /* Cjs */];
11486
11487
  function hasJSFileExtension(fileName) {
11487
11488
  return some(supportedJSExtensionsFlat, (extension) => fileExtensionIs(fileName, extension));
11488
11489
  }
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": "5.1.0-dev.20230406",
5
+ "version": "5.1.0-dev.20230407",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "14.21.1",
114
114
  "npm": "8.19.3"
115
115
  },
116
- "gitHead": "68d8be4f1d89d94a543d93fcedad17f3e4ef297b"
116
+ "gitHead": "85f20246a4a2b424f7d92b463c20886ddf7488f9"
117
117
  }