typescript 5.0.0-dev.20221209 → 5.0.0-dev.20221210

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
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-dev.20221209`;
26
+ var version = `${versionMajorMinor}.0-dev.20221210`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -14662,7 +14662,8 @@ function getSetExternalModuleIndicator(options) {
14662
14662
  }
14663
14663
  }
14664
14664
  function getEmitScriptTarget(compilerOptions) {
14665
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
14665
+ var _a2;
14666
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
14666
14667
  }
14667
14668
  function getEmitModuleKind(compilerOptions) {
14668
14669
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -30096,7 +30097,7 @@ var targetOptionDeclaration = {
30096
30097
  showInSimplifiedHelpView: true,
30097
30098
  category: Diagnostics.Language_and_Environment,
30098
30099
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
30099
- defaultValueDescription: 0 /* ES3 */
30100
+ defaultValueDescription: 1 /* ES5 */
30100
30101
  };
30101
30102
  var moduleOptionDeclaration = {
30102
30103
  name: "module",
@@ -34519,7 +34520,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
34519
34520
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
34520
34521
  return createResolvedModuleWithFailedLookupLocations(
34521
34522
  resolved && resolved.value,
34522
- false,
34523
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
34523
34524
  failedLookupLocations,
34524
34525
  affectingLocations,
34525
34526
  diagnostics,
@@ -45049,7 +45050,8 @@ function createTypeChecker(host) {
45049
45050
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
45050
45051
  const index = pattern.elements.indexOf(declaration);
45051
45052
  if (declaration.dotDotDotToken) {
45052
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
45053
+ const baseConstraint = getBaseConstraintOrType(parentType);
45054
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
45053
45055
  } else if (isArrayLikeType(parentType)) {
45054
45056
  const indexType = getNumberLiteralType(index);
45055
45057
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
package/lib/tsserver.js CHANGED
@@ -2645,7 +2645,7 @@ __export(ts_server_exports3, {
2645
2645
 
2646
2646
  // src/compiler/corePublic.ts
2647
2647
  var versionMajorMinor = "5.0";
2648
- var version = `${versionMajorMinor}.0-dev.20221209`;
2648
+ var version = `${versionMajorMinor}.0-dev.20221210`;
2649
2649
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2650
2650
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2651
2651
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -19103,7 +19103,8 @@ function getSetExternalModuleIndicator(options) {
19103
19103
  }
19104
19104
  }
19105
19105
  function getEmitScriptTarget(compilerOptions) {
19106
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
19106
+ var _a2;
19107
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
19107
19108
  }
19108
19109
  function getEmitModuleKind(compilerOptions) {
19109
19110
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -34757,7 +34758,7 @@ var targetOptionDeclaration = {
34757
34758
  showInSimplifiedHelpView: true,
34758
34759
  category: Diagnostics.Language_and_Environment,
34759
34760
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
34760
- defaultValueDescription: 0 /* ES3 */
34761
+ defaultValueDescription: 1 /* ES5 */
34761
34762
  };
34762
34763
  var moduleOptionDeclaration = {
34763
34764
  name: "module",
@@ -39329,7 +39330,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
39329
39330
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
39330
39331
  return createResolvedModuleWithFailedLookupLocations(
39331
39332
  resolved && resolved.value,
39332
- false,
39333
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
39333
39334
  failedLookupLocations,
39334
39335
  affectingLocations,
39335
39336
  diagnostics,
@@ -49908,7 +49909,8 @@ function createTypeChecker(host) {
49908
49909
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
49909
49910
  const index = pattern.elements.indexOf(declaration);
49910
49911
  if (declaration.dotDotDotToken) {
49911
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
49912
+ const baseConstraint = getBaseConstraintOrType(parentType);
49913
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
49912
49914
  } else if (isArrayLikeType(parentType)) {
49913
49915
  const indexType = getNumberLiteralType(index);
49914
49916
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -133961,7 +133963,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
133961
133963
  source = "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */;
133962
133964
  sortText = SortText.SortBelow(sortText);
133963
133965
  }
133964
- if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
133966
+ if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location.parent) && location.parent.initializer)) {
133965
133967
  let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces";
133966
133968
  const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
133967
133969
  if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) {
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-dev.20221209`;
45
+ version = `${versionMajorMinor}.0-dev.20221210`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -16478,7 +16478,8 @@ ${lanes.join("\n")}
16478
16478
  }
16479
16479
  }
16480
16480
  function getEmitScriptTarget(compilerOptions) {
16481
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
16481
+ var _a2;
16482
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
16482
16483
  }
16483
16484
  function getEmitModuleKind(compilerOptions) {
16484
16485
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -33874,7 +33875,7 @@ ${lanes.join("\n")}
33874
33875
  showInSimplifiedHelpView: true,
33875
33876
  category: Diagnostics.Language_and_Environment,
33876
33877
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
33877
- defaultValueDescription: 0 /* ES3 */
33878
+ defaultValueDescription: 1 /* ES5 */
33878
33879
  };
33879
33880
  moduleOptionDeclaration = {
33880
33881
  name: "module",
@@ -36864,7 +36865,7 @@ ${lanes.join("\n")}
36864
36865
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
36865
36866
  return createResolvedModuleWithFailedLookupLocations(
36866
36867
  resolved && resolved.value,
36867
- false,
36868
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
36868
36869
  failedLookupLocations,
36869
36870
  affectingLocations,
36870
36871
  diagnostics,
@@ -47369,7 +47370,8 @@ ${lanes.join("\n")}
47369
47370
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
47370
47371
  const index = pattern.elements.indexOf(declaration);
47371
47372
  if (declaration.dotDotDotToken) {
47372
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
+ const baseConstraint = getBaseConstraintOrType(parentType);
47374
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
47375
  } else if (isArrayLikeType(parentType)) {
47374
47376
  const indexType = getNumberLiteralType(index);
47375
47377
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -130064,7 +130066,7 @@ ${lanes.join("\n")}
130064
130066
  source = "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */;
130065
130067
  sortText = SortText.SortBelow(sortText);
130066
130068
  }
130067
- if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
130069
+ if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location.parent) && location.parent.initializer)) {
130068
130070
  let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces";
130069
130071
  const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
130070
130072
  if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) {
package/lib/typescript.js CHANGED
@@ -42,7 +42,7 @@ var ts = (() => {
42
42
  "src/compiler/corePublic.ts"() {
43
43
  "use strict";
44
44
  versionMajorMinor = "5.0";
45
- version = `${versionMajorMinor}.0-dev.20221209`;
45
+ version = `${versionMajorMinor}.0-dev.20221210`;
46
46
  Comparison = /* @__PURE__ */ ((Comparison3) => {
47
47
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
48
48
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -16478,7 +16478,8 @@ ${lanes.join("\n")}
16478
16478
  }
16479
16479
  }
16480
16480
  function getEmitScriptTarget(compilerOptions) {
16481
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
16481
+ var _a2;
16482
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
16482
16483
  }
16483
16484
  function getEmitModuleKind(compilerOptions) {
16484
16485
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -33874,7 +33875,7 @@ ${lanes.join("\n")}
33874
33875
  showInSimplifiedHelpView: true,
33875
33876
  category: Diagnostics.Language_and_Environment,
33876
33877
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
33877
- defaultValueDescription: 0 /* ES3 */
33878
+ defaultValueDescription: 1 /* ES5 */
33878
33879
  };
33879
33880
  moduleOptionDeclaration = {
33880
33881
  name: "module",
@@ -36864,7 +36865,7 @@ ${lanes.join("\n")}
36864
36865
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
36865
36866
  return createResolvedModuleWithFailedLookupLocations(
36866
36867
  resolved && resolved.value,
36867
- false,
36868
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
36868
36869
  failedLookupLocations,
36869
36870
  affectingLocations,
36870
36871
  diagnostics,
@@ -47369,7 +47370,8 @@ ${lanes.join("\n")}
47369
47370
  const elementType = checkIteratedTypeOrElementType(65 /* Destructuring */ | (declaration.dotDotDotToken ? 0 : 128 /* PossiblyOutOfBounds */), parentType, undefinedType, pattern);
47370
47371
  const index = pattern.elements.indexOf(declaration);
47371
47372
  if (declaration.dotDotDotToken) {
47372
- type = everyType(parentType, isTupleType) ? mapType(parentType, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
+ const baseConstraint = getBaseConstraintOrType(parentType);
47374
+ type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
47373
47375
  } else if (isArrayLikeType(parentType)) {
47374
47376
  const indexType = getNumberLiteralType(index);
47375
47377
  const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
@@ -130078,7 +130080,7 @@ ${lanes.join("\n")}
130078
130080
  source = "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */;
130079
130081
  sortText = SortText.SortBelow(sortText);
130080
130082
  }
130081
- if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
130083
+ if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none" && !(isJsxAttribute(location.parent) && location.parent.initializer)) {
130082
130084
  let useBraces2 = preferences.jsxAttributeCompletionStyle === "braces";
130083
130085
  const type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
130084
130086
  if (preferences.jsxAttributeCompletionStyle === "auto" && !(type.flags & 528 /* BooleanLike */) && !(type.flags & 1048576 /* Union */ && find(type.types, (type2) => !!(type2.flags & 528 /* BooleanLike */)))) {
@@ -50,7 +50,7 @@ var path = __toESM(require("path"));
50
50
 
51
51
  // src/compiler/corePublic.ts
52
52
  var versionMajorMinor = "5.0";
53
- var version = `${versionMajorMinor}.0-dev.20221209`;
53
+ var version = `${versionMajorMinor}.0-dev.20221210`;
54
54
 
55
55
  // src/compiler/core.ts
56
56
  var emptyArray = [];
@@ -11135,7 +11135,8 @@ function getLanguageVariant(scriptKind) {
11135
11135
  return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;
11136
11136
  }
11137
11137
  function getEmitScriptTarget(compilerOptions) {
11138
- return compilerOptions.target || compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
11138
+ var _a2;
11139
+ return (_a2 = compilerOptions.target) != null ? _a2 : compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */;
11139
11140
  }
11140
11141
  function getEmitModuleKind(compilerOptions) {
11141
11142
  return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
@@ -24275,7 +24276,7 @@ var targetOptionDeclaration = {
24275
24276
  showInSimplifiedHelpView: true,
24276
24277
  category: Diagnostics.Language_and_Environment,
24277
24278
  description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
24278
- defaultValueDescription: 0 /* ES3 */
24279
+ defaultValueDescription: 1 /* ES5 */
24279
24280
  };
24280
24281
  var moduleOptionDeclaration = {
24281
24282
  name: "module",
@@ -26989,7 +26990,7 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
26989
26990
  const resolved = tryResolve(1 /* TypeScript */ | 4 /* Declaration */) || tryResolve(2 /* JavaScript */ | (compilerOptions.resolveJsonModule ? 8 /* Json */ : 0));
26990
26991
  return createResolvedModuleWithFailedLookupLocations(
26991
26992
  resolved && resolved.value,
26992
- false,
26993
+ (resolved == null ? void 0 : resolved.value) && pathContainsNodeModules(resolved.value.path),
26993
26994
  failedLookupLocations,
26994
26995
  affectingLocations,
26995
26996
  diagnostics,
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.0.0-dev.20221209",
5
+ "version": "5.0.0-dev.20221210",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [