@typescript-deploys/pr-build 5.4.0-pr-56780-8 → 5.4.0-pr-56902-8

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.
@@ -55,10 +55,22 @@ declare namespace Intl {
55
55
 
56
56
  const PluralRules: PluralRulesConstructor;
57
57
 
58
- // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:
59
- type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name";
60
- type ES2020NumberFormatPartType = "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown";
61
- type NumberFormatPartTypes = ES2018NumberFormatPartType | ES2020NumberFormatPartType;
58
+ interface NumberFormatPartTypeRegistry {
59
+ literal: any;
60
+ nan: any;
61
+ infinity: any;
62
+ percent: any;
63
+ integer: any;
64
+ group: any;
65
+ decimal: any;
66
+ fraction: any;
67
+ plusSign: any;
68
+ minusSign: any;
69
+ percentSign: any;
70
+ currency: any;
71
+ }
72
+
73
+ type NumberFormatPartTypes = keyof NumberFormatPartTypeRegistry;
62
74
 
63
75
  interface NumberFormatPart {
64
76
  type: NumberFormatPartTypes;
@@ -723,6 +723,5 @@ interface DataView {
723
723
  declare namespace Intl {
724
724
  interface NumberFormat {
725
725
  format(value: number | bigint): string;
726
- resolvedOptions(): ResolvedNumberFormatOptions;
727
726
  }
728
727
  }
@@ -241,24 +241,49 @@ declare namespace Intl {
241
241
  ): UnicodeBCP47LocaleIdentifier[];
242
242
  };
243
243
 
244
+ interface NumberFormatOptionsStyleRegistry {
245
+ unit: any;
246
+ }
247
+
248
+ interface NumberFormatOptionsCurrencyDisplayRegistry {
249
+ narrowSymbol: any;
250
+ }
251
+
252
+ interface NumberFormatOptionsSignDisplayRegistry {
253
+ auto: any;
254
+ never: any;
255
+ always: any;
256
+ exceptZero: any;
257
+ }
258
+
259
+ type NumberFormatOptionsSignDisplay = keyof NumberFormatOptionsSignDisplayRegistry;
260
+
244
261
  interface NumberFormatOptions {
262
+ numberingSystem?: string | undefined;
245
263
  compactDisplay?: "short" | "long" | undefined;
246
264
  notation?: "standard" | "scientific" | "engineering" | "compact" | undefined;
247
- signDisplay?: "auto" | "never" | "always" | "exceptZero" | undefined;
265
+ signDisplay?: NumberFormatOptionsSignDisplay | undefined;
248
266
  unit?: string | undefined;
249
267
  unitDisplay?: "short" | "long" | "narrow" | undefined;
250
- currencyDisplay?: string | undefined;
251
- currencySign?: string | undefined;
268
+ currencySign?: "standard" | "accounting" | undefined;
252
269
  }
253
270
 
254
271
  interface ResolvedNumberFormatOptions {
255
272
  compactDisplay?: "short" | "long";
256
- notation?: "standard" | "scientific" | "engineering" | "compact";
257
- signDisplay?: "auto" | "never" | "always" | "exceptZero";
273
+ notation: "standard" | "scientific" | "engineering" | "compact";
274
+ signDisplay: NumberFormatOptionsSignDisplay;
258
275
  unit?: string;
259
276
  unitDisplay?: "short" | "long" | "narrow";
260
- currencyDisplay?: string;
261
- currencySign?: string;
277
+ currencySign?: "standard" | "accounting";
278
+ }
279
+
280
+ interface NumberFormatPartTypeRegistry {
281
+ compact: any;
282
+ exponentInteger: any;
283
+ exponentMinusSign: any;
284
+ exponentSeparator: any;
285
+ unit: any;
286
+ unknown: any;
262
287
  }
263
288
 
264
289
  interface DateTimeFormatOptions {
@@ -19,3 +19,4 @@ and limitations under the License.
19
19
  /// <reference lib="es2022" />
20
20
  /// <reference lib="es2023.array" />
21
21
  /// <reference lib="es2023.collection" />
22
+ /// <reference lib="es2023.intl" />
@@ -0,0 +1,52 @@
1
+ /*! *****************************************************************************
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4
+ this file except in compliance with the License. You may obtain a copy of the
5
+ License at http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10
+ MERCHANTABLITY OR NON-INFRINGEMENT.
11
+
12
+ See the Apache Version 2.0 License for specific language governing permissions
13
+ and limitations under the License.
14
+ ***************************************************************************** */
15
+
16
+
17
+ /// <reference no-default-lib="true"/>
18
+
19
+ declare namespace Intl {
20
+ interface NumberFormatOptionsUseGroupingRegistry {
21
+ min2: any;
22
+ auto: any;
23
+ always: any;
24
+ }
25
+
26
+ interface NumberFormatOptionsSignDisplayRegistry {
27
+ negative: any;
28
+ }
29
+
30
+ interface NumberFormatOptions {
31
+ roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined;
32
+ roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined;
33
+ roundingMode?: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven" | undefined;
34
+ trailingZeroDisplay?: "auto" | "stripIfInteger" | undefined;
35
+ }
36
+
37
+ interface ResolvedNumberFormatOptions {
38
+ roundingPriority: "auto" | "morePrecision" | "lessPrecision";
39
+ roundingMode: "ceil" | "floor" | "expand" | "trunc" | "halfCeil" | "halfFloor" | "halfExpand" | "halfTrunc" | "halfEven";
40
+ roundingIncrement: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000;
41
+ trailingZeroDisplay: "auto" | "stripIfInteger";
42
+ }
43
+
44
+ interface NumberRangeFormatPart extends NumberFormatPart {
45
+ source: "startRange" | "endRange" | "shared";
46
+ }
47
+
48
+ interface NumberFormat {
49
+ formatRange(start: number | bigint, end: number | bigint): string;
50
+ formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[];
51
+ }
52
+ }
package/lib/lib.es5.d.ts CHANGED
@@ -4427,12 +4427,33 @@ declare namespace Intl {
4427
4427
 
4428
4428
  var Collator: CollatorConstructor;
4429
4429
 
4430
+ interface NumberFormatOptionsStyleRegistry {
4431
+ decimal: any;
4432
+ percent: any;
4433
+ currency: any;
4434
+ }
4435
+
4436
+ type NumberFormatOptionsStyle = keyof NumberFormatOptionsStyleRegistry;
4437
+
4438
+ interface NumberFormatOptionsCurrencyDisplayRegistry {
4439
+ code: any;
4440
+ symbol: any;
4441
+ name: any;
4442
+ }
4443
+
4444
+ type NumberFormatOptionsCurrencyDisplay = keyof NumberFormatOptionsCurrencyDisplayRegistry;
4445
+
4446
+ interface NumberFormatOptionsUseGroupingRegistry {}
4447
+
4448
+ type NumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | "true" | "false" | boolean;
4449
+ type ResolvedNumberFormatOptionsUseGrouping = {} extends NumberFormatOptionsUseGroupingRegistry ? boolean : keyof NumberFormatOptionsUseGroupingRegistry | false;
4450
+
4430
4451
  interface NumberFormatOptions {
4431
- localeMatcher?: string | undefined;
4432
- style?: string | undefined;
4452
+ localeMatcher?: "lookup" | "best fit" | undefined;
4453
+ style?: NumberFormatOptionsStyle | undefined;
4433
4454
  currency?: string | undefined;
4434
- currencySign?: string | undefined;
4435
- useGrouping?: boolean | undefined;
4455
+ currencyDisplay?: NumberFormatOptionsCurrencyDisplay | undefined;
4456
+ useGrouping?: NumberFormatOptionsUseGrouping | undefined;
4436
4457
  minimumIntegerDigits?: number | undefined;
4437
4458
  minimumFractionDigits?: number | undefined;
4438
4459
  maximumFractionDigits?: number | undefined;
@@ -4443,14 +4464,15 @@ declare namespace Intl {
4443
4464
  interface ResolvedNumberFormatOptions {
4444
4465
  locale: string;
4445
4466
  numberingSystem: string;
4446
- style: string;
4467
+ style: NumberFormatOptionsStyle;
4447
4468
  currency?: string;
4469
+ currencyDisplay?: NumberFormatOptionsCurrencyDisplay;
4448
4470
  minimumIntegerDigits: number;
4449
4471
  minimumFractionDigits: number;
4450
4472
  maximumFractionDigits: number;
4451
4473
  minimumSignificantDigits?: number;
4452
4474
  maximumSignificantDigits?: number;
4453
- useGrouping: boolean;
4475
+ useGrouping: ResolvedNumberFormatOptionsUseGrouping;
4454
4476
  }
4455
4477
 
4456
4478
  interface NumberFormat {
@@ -17,12 +17,5 @@ and limitations under the License.
17
17
  /// <reference no-default-lib="true"/>
18
18
 
19
19
  declare namespace Intl {
20
- interface NumberRangeFormatPart extends NumberFormatPart {
21
- source: "startRange" | "endRange" | "shared";
22
- }
23
-
24
- interface NumberFormat {
25
- formatRange(start: number | bigint, end: number | bigint): string;
26
- formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[];
27
- }
20
+ // Empty
28
21
  }
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.4";
21
- var version = `${versionMajorMinor}.0-insiders.20240102`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240104`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -33755,7 +33755,25 @@ var IncrementalParser;
33755
33755
  })(InvalidPosition || (InvalidPosition = {}));
33756
33756
  })(IncrementalParser || (IncrementalParser = {}));
33757
33757
  function isDeclarationFileName(fileName) {
33758
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
33758
+ return getDeclarationFileExtension(fileName) !== void 0;
33759
+ }
33760
+ function getDeclarationFileExtension(fileName) {
33761
+ const standardExtension = getAnyExtensionFromPath(
33762
+ fileName,
33763
+ supportedDeclarationExtensions,
33764
+ /*ignoreCase*/
33765
+ false
33766
+ );
33767
+ if (standardExtension) {
33768
+ return standardExtension;
33769
+ }
33770
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
33771
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
33772
+ if (index >= 0) {
33773
+ return fileName.substring(index);
33774
+ }
33775
+ }
33776
+ return void 0;
33759
33777
  }
33760
33778
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
33761
33779
  if (!mode) {
@@ -34058,6 +34076,7 @@ var libEntries = [
34058
34076
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
34059
34077
  ["es2023.array", "lib.es2023.array.d.ts"],
34060
34078
  ["es2023.collection", "lib.es2023.collection.d.ts"],
34079
+ ["es2023.intl", "lib.es2023.intl.d.ts"],
34061
34080
  ["esnext.array", "lib.es2023.array.d.ts"],
34062
34081
  ["esnext.collection", "lib.es2023.collection.d.ts"],
34063
34082
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
@@ -50961,7 +50980,7 @@ function createTypeChecker(host) {
50961
50980
  });
50962
50981
  }
50963
50982
  function serializeAsAlias(symbol, localName, modifierFlags) {
50964
- var _a2, _b, _c, _d, _e;
50983
+ var _a2, _b, _c, _d, _e, _f;
50965
50984
  const node = getDeclarationOfAliasSymbol(symbol);
50966
50985
  if (!node)
50967
50986
  return Debug.fail();
@@ -51159,6 +51178,9 @@ function createTypeChecker(host) {
51159
51178
  }
51160
51179
  case 281 /* ExportSpecifier */:
51161
51180
  const specifier = node.parent.parent.moduleSpecifier;
51181
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
51182
+ verbatimTargetName = "default" /* Default */;
51183
+ }
51162
51184
  serializeExportSpecifier(
51163
51185
  unescapeLeadingUnderscores(symbol.escapedName),
51164
51186
  specifier ? verbatimTargetName : targetName,
@@ -52162,7 +52184,7 @@ function createTypeChecker(host) {
52162
52184
  if (declaration.dotDotDotToken) {
52163
52185
  const baseConstraint = mapType(parentType, (t) => t.flags & 58982400 /* InstantiableNonPrimitive */ ? getBaseConstraintOrType(t) : t);
52164
52186
  type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
52165
- } else if (isArrayLikeType(parentType) && !isErrorType(elementType)) {
52187
+ } else if (isArrayLikeType(parentType)) {
52166
52188
  const indexType = getNumberLiteralType(index);
52167
52189
  const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
52168
52190
  const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
@@ -58209,7 +58231,7 @@ function createTypeChecker(host) {
58209
58231
  }
58210
58232
  }
58211
58233
  if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) {
58212
- if (objectType.flags & 1 /* Any */ || objectType.flags & 131072 /* Never */ && !(accessFlags & 32 /* ExpressionPosition */)) {
58234
+ if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
58213
58235
  return objectType;
58214
58236
  }
58215
58237
  const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
@@ -64634,6 +64656,9 @@ function createTypeChecker(host) {
64634
64656
  inferToTemplateLiteralType(source, target);
64635
64657
  } else {
64636
64658
  source = getReducedType(source);
64659
+ if (isGenericMappedType(source) && isGenericMappedType(target)) {
64660
+ invokeOnce(source, target, inferFromGenericMappedTypes);
64661
+ }
64637
64662
  if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
64638
64663
  const apparentSource = getApparentType(source);
64639
64664
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
@@ -64897,6 +64922,14 @@ function createTypeChecker(host) {
64897
64922
  }
64898
64923
  }
64899
64924
  }
64925
+ function inferFromGenericMappedTypes(source, target) {
64926
+ inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
64927
+ inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
64928
+ const sourceNameType = getNameTypeFromMappedType(source);
64929
+ const targetNameType = getNameTypeFromMappedType(target);
64930
+ if (sourceNameType && targetNameType)
64931
+ inferFromTypes(sourceNameType, targetNameType);
64932
+ }
64900
64933
  function inferFromObjectTypes(source, target) {
64901
64934
  var _a, _b;
64902
64935
  if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
@@ -64904,12 +64937,7 @@ function createTypeChecker(host) {
64904
64937
  return;
64905
64938
  }
64906
64939
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
64907
- inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
64908
- inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
64909
- const sourceNameType = getNameTypeFromMappedType(source);
64910
- const targetNameType = getNameTypeFromMappedType(target);
64911
- if (sourceNameType && targetNameType)
64912
- inferFromTypes(sourceNameType, targetNameType);
64940
+ inferFromGenericMappedTypes(source, target);
64913
64941
  }
64914
64942
  if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
64915
64943
  const constraintType = getConstraintTypeFromMappedType(target);
@@ -78733,7 +78761,7 @@ function createTypeChecker(host) {
78733
78761
  const allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0;
78734
78762
  if (inputType === neverType) {
78735
78763
  reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables);
78736
- return errorType;
78764
+ return void 0;
78737
78765
  }
78738
78766
  const uplevelIteration = languageVersion >= 2 /* ES2015 */;
78739
78767
  const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
package/lib/tsserver.js CHANGED
@@ -269,6 +269,7 @@ __export(server_exports, {
269
269
  changeAnyExtension: () => changeAnyExtension,
270
270
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
271
271
  changeExtension: () => changeExtension,
272
+ changeFullExtension: () => changeFullExtension,
272
273
  changesAffectModuleResolution: () => changesAffectModuleResolution,
273
274
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
274
275
  childIsDecorated: () => childIsDecorated,
@@ -708,6 +709,7 @@ __export(server_exports, {
708
709
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
709
710
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
710
711
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
712
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
711
713
  getDeclarationFromName: () => getDeclarationFromName,
712
714
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
713
715
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -2339,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
2339
2341
 
2340
2342
  // src/compiler/corePublic.ts
2341
2343
  var versionMajorMinor = "5.4";
2342
- var version = `${versionMajorMinor}.0-insiders.20240102`;
2344
+ var version = `${versionMajorMinor}.0-insiders.20240104`;
2343
2345
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2344
2346
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2345
2347
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9107,6 +9109,13 @@ function changeAnyExtension(path, ext, extensions, ignoreCase) {
9107
9109
  const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
9108
9110
  return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
9109
9111
  }
9112
+ function changeFullExtension(path, newExtension) {
9113
+ const declarationExtension = getDeclarationFileExtension(path);
9114
+ if (declarationExtension) {
9115
+ return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
9116
+ }
9117
+ return changeAnyExtension(path, newExtension);
9118
+ }
9110
9119
  var relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
9111
9120
  function comparePathsWorker(a, b, componentComparer) {
9112
9121
  if (a === b)
@@ -38174,7 +38183,25 @@ var IncrementalParser;
38174
38183
  })(InvalidPosition || (InvalidPosition = {}));
38175
38184
  })(IncrementalParser || (IncrementalParser = {}));
38176
38185
  function isDeclarationFileName(fileName) {
38177
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
38186
+ return getDeclarationFileExtension(fileName) !== void 0;
38187
+ }
38188
+ function getDeclarationFileExtension(fileName) {
38189
+ const standardExtension = getAnyExtensionFromPath(
38190
+ fileName,
38191
+ supportedDeclarationExtensions,
38192
+ /*ignoreCase*/
38193
+ false
38194
+ );
38195
+ if (standardExtension) {
38196
+ return standardExtension;
38197
+ }
38198
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
38199
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
38200
+ if (index >= 0) {
38201
+ return fileName.substring(index);
38202
+ }
38203
+ }
38204
+ return void 0;
38178
38205
  }
38179
38206
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
38180
38207
  if (!mode) {
@@ -38477,6 +38504,7 @@ var libEntries = [
38477
38504
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
38478
38505
  ["es2023.array", "lib.es2023.array.d.ts"],
38479
38506
  ["es2023.collection", "lib.es2023.collection.d.ts"],
38507
+ ["es2023.intl", "lib.es2023.intl.d.ts"],
38480
38508
  ["esnext.array", "lib.es2023.array.d.ts"],
38481
38509
  ["esnext.collection", "lib.es2023.collection.d.ts"],
38482
38510
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
@@ -43173,7 +43201,7 @@ function loadEntrypointsFromExportMap(scope, exports2, state, extensions) {
43173
43201
  /*excludes*/
43174
43202
  void 0,
43175
43203
  [
43176
- isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
43204
+ changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
43177
43205
  ]
43178
43206
  ).forEach((entry) => {
43179
43207
  entrypoints = appendIfUnique(entrypoints, {
@@ -55680,7 +55708,7 @@ function createTypeChecker(host) {
55680
55708
  });
55681
55709
  }
55682
55710
  function serializeAsAlias(symbol, localName, modifierFlags) {
55683
- var _a2, _b, _c, _d, _e;
55711
+ var _a2, _b, _c, _d, _e, _f;
55684
55712
  const node = getDeclarationOfAliasSymbol(symbol);
55685
55713
  if (!node)
55686
55714
  return Debug.fail();
@@ -55878,6 +55906,9 @@ function createTypeChecker(host) {
55878
55906
  }
55879
55907
  case 281 /* ExportSpecifier */:
55880
55908
  const specifier = node.parent.parent.moduleSpecifier;
55909
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
55910
+ verbatimTargetName = "default" /* Default */;
55911
+ }
55881
55912
  serializeExportSpecifier(
55882
55913
  unescapeLeadingUnderscores(symbol.escapedName),
55883
55914
  specifier ? verbatimTargetName : targetName,
@@ -56881,7 +56912,7 @@ function createTypeChecker(host) {
56881
56912
  if (declaration.dotDotDotToken) {
56882
56913
  const baseConstraint = mapType(parentType, (t) => t.flags & 58982400 /* InstantiableNonPrimitive */ ? getBaseConstraintOrType(t) : t);
56883
56914
  type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
56884
- } else if (isArrayLikeType(parentType) && !isErrorType(elementType)) {
56915
+ } else if (isArrayLikeType(parentType)) {
56885
56916
  const indexType = getNumberLiteralType(index);
56886
56917
  const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
56887
56918
  const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
@@ -62928,7 +62959,7 @@ function createTypeChecker(host) {
62928
62959
  }
62929
62960
  }
62930
62961
  if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) {
62931
- if (objectType.flags & 1 /* Any */ || objectType.flags & 131072 /* Never */ && !(accessFlags & 32 /* ExpressionPosition */)) {
62962
+ if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
62932
62963
  return objectType;
62933
62964
  }
62934
62965
  const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
@@ -69353,6 +69384,9 @@ function createTypeChecker(host) {
69353
69384
  inferToTemplateLiteralType(source, target);
69354
69385
  } else {
69355
69386
  source = getReducedType(source);
69387
+ if (isGenericMappedType(source) && isGenericMappedType(target)) {
69388
+ invokeOnce(source, target, inferFromGenericMappedTypes);
69389
+ }
69356
69390
  if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
69357
69391
  const apparentSource = getApparentType(source);
69358
69392
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
@@ -69616,6 +69650,14 @@ function createTypeChecker(host) {
69616
69650
  }
69617
69651
  }
69618
69652
  }
69653
+ function inferFromGenericMappedTypes(source, target) {
69654
+ inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
69655
+ inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
69656
+ const sourceNameType = getNameTypeFromMappedType(source);
69657
+ const targetNameType = getNameTypeFromMappedType(target);
69658
+ if (sourceNameType && targetNameType)
69659
+ inferFromTypes(sourceNameType, targetNameType);
69660
+ }
69619
69661
  function inferFromObjectTypes(source, target) {
69620
69662
  var _a, _b;
69621
69663
  if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
@@ -69623,12 +69665,7 @@ function createTypeChecker(host) {
69623
69665
  return;
69624
69666
  }
69625
69667
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
69626
- inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
69627
- inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
69628
- const sourceNameType = getNameTypeFromMappedType(source);
69629
- const targetNameType = getNameTypeFromMappedType(target);
69630
- if (sourceNameType && targetNameType)
69631
- inferFromTypes(sourceNameType, targetNameType);
69668
+ inferFromGenericMappedTypes(source, target);
69632
69669
  }
69633
69670
  if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
69634
69671
  const constraintType = getConstraintTypeFromMappedType(target);
@@ -83452,7 +83489,7 @@ function createTypeChecker(host) {
83452
83489
  const allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0;
83453
83490
  if (inputType === neverType) {
83454
83491
  reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables);
83455
- return errorType;
83492
+ return void 0;
83456
83493
  }
83457
83494
  const uplevelIteration = languageVersion >= 2 /* ES2015 */;
83458
83495
  const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
@@ -134226,10 +134263,11 @@ function buildLinkParts(link, checker) {
134226
134263
  }
134227
134264
  } else {
134228
134265
  const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link.name);
134266
+ const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0;
134229
134267
  const suffix = findLinkNameEnd(link.text);
134230
134268
  const name = getTextOfNode(link.name) + link.text.slice(0, suffix);
134231
134269
  const text = skipSeparatorFromLinkText(link.text.slice(suffix));
134232
- const decl = (symbol == null ? void 0 : symbol.valueDeclaration) || ((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a[0]);
134270
+ const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a[0]);
134233
134271
  if (decl) {
134234
134272
  parts.push(linkNamePart(name, decl));
134235
134273
  if (text)
@@ -147091,13 +147129,14 @@ function getPropertySymbolsFromContextualType(node, checker, contextualType, uni
147091
147129
  const symbol = contextualType.getProperty(name);
147092
147130
  return symbol ? [symbol] : emptyArray;
147093
147131
  }
147094
- const discriminatedPropertySymbols = mapDefined(contextualType.types, (t) => (isObjectLiteralExpression(node.parent) || isJsxAttributes(node.parent)) && checker.isTypeInvalidDueToUnionDiscriminant(t, node.parent) ? void 0 : t.getProperty(name));
147132
+ const filteredTypes = isObjectLiteralExpression(node.parent) || isJsxAttributes(node.parent) ? filter(contextualType.types, (t) => !checker.isTypeInvalidDueToUnionDiscriminant(t, node.parent)) : contextualType.types;
147133
+ const discriminatedPropertySymbols = mapDefined(filteredTypes, (t) => t.getProperty(name));
147095
147134
  if (unionSymbolOk && (discriminatedPropertySymbols.length === 0 || discriminatedPropertySymbols.length === contextualType.types.length)) {
147096
147135
  const symbol = contextualType.getProperty(name);
147097
147136
  if (symbol)
147098
147137
  return [symbol];
147099
147138
  }
147100
- if (discriminatedPropertySymbols.length === 0) {
147139
+ if (!filteredTypes.length && !discriminatedPropertySymbols.length) {
147101
147140
  return mapDefined(contextualType.types, (t) => t.getProperty(name));
147102
147141
  }
147103
147142
  return deduplicate(discriminatedPropertySymbols, equateValues);
@@ -153756,21 +153795,14 @@ function addEnumMemberDeclaration(changes, checker, { token, parentDeclaration }
153756
153795
  const type = checker.getTypeAtLocation(member);
153757
153796
  return !!(type && type.flags & 402653316 /* StringLike */);
153758
153797
  });
153798
+ const sourceFile = parentDeclaration.getSourceFile();
153759
153799
  const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0);
153760
- changes.replaceNode(
153761
- parentDeclaration.getSourceFile(),
153762
- parentDeclaration,
153763
- factory.updateEnumDeclaration(
153764
- parentDeclaration,
153765
- parentDeclaration.modifiers,
153766
- parentDeclaration.name,
153767
- concatenate(parentDeclaration.members, singleElementArray(enumMember))
153768
- ),
153769
- {
153770
- leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
153771
- trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude
153772
- }
153773
- );
153800
+ const last2 = lastOrUndefined(parentDeclaration.members);
153801
+ if (last2) {
153802
+ changes.insertNodeInListAfter(sourceFile, last2, enumMember, parentDeclaration.members);
153803
+ } else {
153804
+ changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember);
153805
+ }
153774
153806
  }
153775
153807
  function addFunctionDeclaration(changes, context, info) {
153776
153808
  const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
@@ -170298,7 +170330,7 @@ ${options.prefix}` : "\n" : options.prefix
170298
170330
  const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
170299
170331
  multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
170300
170332
  }
170301
- if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
170333
+ if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) {
170302
170334
  multilineList = true;
170303
170335
  }
170304
170336
  if (multilineList) {
@@ -173953,6 +173985,7 @@ __export(ts_exports2, {
173953
173985
  changeAnyExtension: () => changeAnyExtension,
173954
173986
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
173955
173987
  changeExtension: () => changeExtension,
173988
+ changeFullExtension: () => changeFullExtension,
173956
173989
  changesAffectModuleResolution: () => changesAffectModuleResolution,
173957
173990
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
173958
173991
  childIsDecorated: () => childIsDecorated,
@@ -174392,6 +174425,7 @@ __export(ts_exports2, {
174392
174425
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
174393
174426
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
174394
174427
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
174428
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
174395
174429
  getDeclarationFromName: () => getDeclarationFromName,
174396
174430
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
174397
174431
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -188752,6 +188786,7 @@ start(initializeNodeSystem(), require("os").platform());
188752
188786
  changeAnyExtension,
188753
188787
  changeCompilerHostLikeToUseCache,
188754
188788
  changeExtension,
188789
+ changeFullExtension,
188755
188790
  changesAffectModuleResolution,
188756
188791
  changesAffectingProgramStructure,
188757
188792
  childIsDecorated,
@@ -189191,6 +189226,7 @@ start(initializeNodeSystem(), require("os").platform());
189191
189226
  getDeclarationEmitExtensionForPath,
189192
189227
  getDeclarationEmitOutputFilePath,
189193
189228
  getDeclarationEmitOutputFilePathWorker,
189229
+ getDeclarationFileExtension,
189194
189230
  getDeclarationFromName,
189195
189231
  getDeclarationModifierFlagsFromSymbol,
189196
189232
  getDeclarationOfKind,
@@ -9914,13 +9914,13 @@ declare namespace ts {
9914
9914
  * A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
9915
9915
  * `options` parameter.
9916
9916
  *
9917
- * @param fileName The normalized absolute path to check the format of (it need not exist on disk)
9917
+ * @param fileName The file name to check the format of (it need not exist on disk)
9918
9918
  * @param [packageJsonInfoCache] A cache for package file lookups - it's best to have a cache when this function is called often
9919
9919
  * @param host The ModuleResolutionHost which can perform the filesystem lookups for package json data
9920
9920
  * @param options The compiler options to perform the analysis under - relevant options are `moduleResolution` and `traceResolution`
9921
9921
  * @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
9922
9922
  */
9923
- function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
9923
+ function getImpliedNodeFormatForFile(fileName: string, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ResolutionMode;
9924
9924
  /**
9925
9925
  * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
9926
9926
  * that represent a compilation unit.
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.4";
38
- version = `${versionMajorMinor}.0-insiders.20240102`;
38
+ version = `${versionMajorMinor}.0-insiders.20240104`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6862,6 +6862,13 @@ ${lanes.join("\n")}
6862
6862
  const pathext = extensions !== void 0 && ignoreCase !== void 0 ? getAnyExtensionFromPath(path, extensions, ignoreCase) : getAnyExtensionFromPath(path);
6863
6863
  return pathext ? path.slice(0, path.length - pathext.length) + (startsWith(ext, ".") ? ext : "." + ext) : path;
6864
6864
  }
6865
+ function changeFullExtension(path, newExtension) {
6866
+ const declarationExtension = getDeclarationFileExtension(path);
6867
+ if (declarationExtension) {
6868
+ return path.slice(0, path.length - declarationExtension.length) + (startsWith(newExtension, ".") ? newExtension : "." + newExtension);
6869
+ }
6870
+ return changeAnyExtension(path, newExtension);
6871
+ }
6865
6872
  function comparePathsWorker(a, b, componentComparer) {
6866
6873
  if (a === b)
6867
6874
  return 0 /* EqualTo */;
@@ -28453,7 +28460,25 @@ ${lanes.join("\n")}
28453
28460
  return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length2);
28454
28461
  }
28455
28462
  function isDeclarationFileName(fileName) {
28456
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
28463
+ return getDeclarationFileExtension(fileName) !== void 0;
28464
+ }
28465
+ function getDeclarationFileExtension(fileName) {
28466
+ const standardExtension = getAnyExtensionFromPath(
28467
+ fileName,
28468
+ supportedDeclarationExtensions,
28469
+ /*ignoreCase*/
28470
+ false
28471
+ );
28472
+ if (standardExtension) {
28473
+ return standardExtension;
28474
+ }
28475
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
28476
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
28477
+ if (index >= 0) {
28478
+ return fileName.substring(index);
28479
+ }
28480
+ }
28481
+ return void 0;
28457
28482
  }
28458
28483
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
28459
28484
  if (!mode) {
@@ -37973,6 +37998,7 @@ ${lanes.join("\n")}
37973
37998
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
37974
37999
  ["es2023.array", "lib.es2023.array.d.ts"],
37975
38000
  ["es2023.collection", "lib.es2023.collection.d.ts"],
38001
+ ["es2023.intl", "lib.es2023.intl.d.ts"],
37976
38002
  ["esnext.array", "lib.es2023.array.d.ts"],
37977
38003
  ["esnext.collection", "lib.es2023.collection.d.ts"],
37978
38004
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
@@ -41006,7 +41032,7 @@ ${lanes.join("\n")}
41006
41032
  /*excludes*/
41007
41033
  void 0,
41008
41034
  [
41009
- isDeclarationFileName(target) ? replaceFirstStar(target, "**/*") : changeAnyExtension(replaceFirstStar(target, "**/*"), getDeclarationEmitExtensionForPath(target))
41035
+ changeFullExtension(replaceFirstStar(target, "**/*"), ".*")
41010
41036
  ]
41011
41037
  ).forEach((entry) => {
41012
41038
  entrypoints = appendIfUnique(entrypoints, {
@@ -53436,7 +53462,7 @@ ${lanes.join("\n")}
53436
53462
  });
53437
53463
  }
53438
53464
  function serializeAsAlias(symbol, localName, modifierFlags) {
53439
- var _a2, _b, _c, _d, _e;
53465
+ var _a2, _b, _c, _d, _e, _f;
53440
53466
  const node = getDeclarationOfAliasSymbol(symbol);
53441
53467
  if (!node)
53442
53468
  return Debug.fail();
@@ -53634,6 +53660,9 @@ ${lanes.join("\n")}
53634
53660
  }
53635
53661
  case 281 /* ExportSpecifier */:
53636
53662
  const specifier = node.parent.parent.moduleSpecifier;
53663
+ if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
53664
+ verbatimTargetName = "default" /* Default */;
53665
+ }
53637
53666
  serializeExportSpecifier(
53638
53667
  unescapeLeadingUnderscores(symbol.escapedName),
53639
53668
  specifier ? verbatimTargetName : targetName,
@@ -54637,7 +54666,7 @@ ${lanes.join("\n")}
54637
54666
  if (declaration.dotDotDotToken) {
54638
54667
  const baseConstraint = mapType(parentType, (t) => t.flags & 58982400 /* InstantiableNonPrimitive */ ? getBaseConstraintOrType(t) : t);
54639
54668
  type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
54640
- } else if (isArrayLikeType(parentType) && !isErrorType(elementType)) {
54669
+ } else if (isArrayLikeType(parentType)) {
54641
54670
  const indexType = getNumberLiteralType(index);
54642
54671
  const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
54643
54672
  const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
@@ -60684,7 +60713,7 @@ ${lanes.join("\n")}
60684
60713
  }
60685
60714
  }
60686
60715
  if (!(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */)) {
60687
- if (objectType.flags & 1 /* Any */ || objectType.flags & 131072 /* Never */ && !(accessFlags & 32 /* ExpressionPosition */)) {
60716
+ if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
60688
60717
  return objectType;
60689
60718
  }
60690
60719
  const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
@@ -67109,6 +67138,9 @@ ${lanes.join("\n")}
67109
67138
  inferToTemplateLiteralType(source, target);
67110
67139
  } else {
67111
67140
  source = getReducedType(source);
67141
+ if (isGenericMappedType(source) && isGenericMappedType(target)) {
67142
+ invokeOnce(source, target, inferFromGenericMappedTypes);
67143
+ }
67112
67144
  if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
67113
67145
  const apparentSource = getApparentType(source);
67114
67146
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
@@ -67372,6 +67404,14 @@ ${lanes.join("\n")}
67372
67404
  }
67373
67405
  }
67374
67406
  }
67407
+ function inferFromGenericMappedTypes(source, target) {
67408
+ inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
67409
+ inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
67410
+ const sourceNameType = getNameTypeFromMappedType(source);
67411
+ const targetNameType = getNameTypeFromMappedType(target);
67412
+ if (sourceNameType && targetNameType)
67413
+ inferFromTypes(sourceNameType, targetNameType);
67414
+ }
67375
67415
  function inferFromObjectTypes(source, target) {
67376
67416
  var _a, _b;
67377
67417
  if (getObjectFlags(source) & 4 /* Reference */ && getObjectFlags(target) & 4 /* Reference */ && (source.target === target.target || isArrayType(source) && isArrayType(target))) {
@@ -67379,12 +67419,7 @@ ${lanes.join("\n")}
67379
67419
  return;
67380
67420
  }
67381
67421
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
67382
- inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
67383
- inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
67384
- const sourceNameType = getNameTypeFromMappedType(source);
67385
- const targetNameType = getNameTypeFromMappedType(target);
67386
- if (sourceNameType && targetNameType)
67387
- inferFromTypes(sourceNameType, targetNameType);
67422
+ inferFromGenericMappedTypes(source, target);
67388
67423
  }
67389
67424
  if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
67390
67425
  const constraintType = getConstraintTypeFromMappedType(target);
@@ -81208,7 +81243,7 @@ ${lanes.join("\n")}
81208
81243
  const allowAsyncIterables = (use & 2 /* AllowsAsyncIterablesFlag */) !== 0;
81209
81244
  if (inputType === neverType) {
81210
81245
  reportTypeNotIterableError(errorNode, inputType, allowAsyncIterables);
81211
- return errorType;
81246
+ return void 0;
81212
81247
  }
81213
81248
  const uplevelIteration = languageVersion >= 2 /* ES2015 */;
81214
81249
  const downlevelIteration = !uplevelIteration && compilerOptions.downlevelIteration;
@@ -132481,10 +132516,11 @@ ${lanes.join("\n")}
132481
132516
  }
132482
132517
  } else {
132483
132518
  const symbol = checker == null ? void 0 : checker.getSymbolAtLocation(link.name);
132519
+ const targetSymbol = symbol && checker ? getSymbolTarget(symbol, checker) : void 0;
132484
132520
  const suffix = findLinkNameEnd(link.text);
132485
132521
  const name = getTextOfNode(link.name) + link.text.slice(0, suffix);
132486
132522
  const text = skipSeparatorFromLinkText(link.text.slice(suffix));
132487
- const decl = (symbol == null ? void 0 : symbol.valueDeclaration) || ((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a[0]);
132523
+ const decl = (targetSymbol == null ? void 0 : targetSymbol.valueDeclaration) || ((_a = targetSymbol == null ? void 0 : targetSymbol.declarations) == null ? void 0 : _a[0]);
132488
132524
  if (decl) {
132489
132525
  parts.push(linkNamePart(name, decl));
132490
132526
  if (text)
@@ -145023,13 +145059,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
145023
145059
  const symbol = contextualType.getProperty(name);
145024
145060
  return symbol ? [symbol] : emptyArray;
145025
145061
  }
145026
- const discriminatedPropertySymbols = mapDefined(contextualType.types, (t) => (isObjectLiteralExpression(node.parent) || isJsxAttributes(node.parent)) && checker.isTypeInvalidDueToUnionDiscriminant(t, node.parent) ? void 0 : t.getProperty(name));
145062
+ const filteredTypes = isObjectLiteralExpression(node.parent) || isJsxAttributes(node.parent) ? filter(contextualType.types, (t) => !checker.isTypeInvalidDueToUnionDiscriminant(t, node.parent)) : contextualType.types;
145063
+ const discriminatedPropertySymbols = mapDefined(filteredTypes, (t) => t.getProperty(name));
145027
145064
  if (unionSymbolOk && (discriminatedPropertySymbols.length === 0 || discriminatedPropertySymbols.length === contextualType.types.length)) {
145028
145065
  const symbol = contextualType.getProperty(name);
145029
145066
  if (symbol)
145030
145067
  return [symbol];
145031
145068
  }
145032
- if (discriminatedPropertySymbols.length === 0) {
145069
+ if (!filteredTypes.length && !discriminatedPropertySymbols.length) {
145033
145070
  return mapDefined(contextualType.types, (t) => t.getProperty(name));
145034
145071
  }
145035
145072
  return deduplicate(discriminatedPropertySymbols, equateValues);
@@ -152499,21 +152536,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152499
152536
  const type = checker.getTypeAtLocation(member);
152500
152537
  return !!(type && type.flags & 402653316 /* StringLike */);
152501
152538
  });
152539
+ const sourceFile = parentDeclaration.getSourceFile();
152502
152540
  const enumMember = factory.createEnumMember(token, hasStringInitializer ? factory.createStringLiteral(token.text) : void 0);
152503
- changes.replaceNode(
152504
- parentDeclaration.getSourceFile(),
152505
- parentDeclaration,
152506
- factory.updateEnumDeclaration(
152507
- parentDeclaration,
152508
- parentDeclaration.modifiers,
152509
- parentDeclaration.name,
152510
- concatenate(parentDeclaration.members, singleElementArray(enumMember))
152511
- ),
152512
- {
152513
- leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.IncludeAll,
152514
- trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.Exclude
152515
- }
152516
- );
152541
+ const last2 = lastOrUndefined(parentDeclaration.members);
152542
+ if (last2) {
152543
+ changes.insertNodeInListAfter(sourceFile, last2, enumMember, parentDeclaration.members);
152544
+ } else {
152545
+ changes.insertMemberAtStart(sourceFile, parentDeclaration, enumMember);
152546
+ }
152517
152547
  }
152518
152548
  function addFunctionDeclaration(changes, context, info) {
152519
152549
  const quotePreference = getQuotePreference(context.sourceFile, context.preferences);
@@ -170151,7 +170181,7 @@ ${options.prefix}` : "\n" : options.prefix
170151
170181
  const afterMinusOneStartLinePosition = getLineStartPositionForPosition(containingList[index - 1].getStart(sourceFile), sourceFile);
170152
170182
  multilineList = afterMinusOneStartLinePosition !== afterStartLinePosition;
170153
170183
  }
170154
- if (hasCommentsBeforeLineBreak(sourceFile.text, after.end)) {
170184
+ if (hasCommentsBeforeLineBreak(sourceFile.text, after.end) || !positionsAreOnSameLine(containingList.pos, containingList.end, sourceFile)) {
170155
170185
  multilineList = true;
170156
170186
  }
170157
170187
  if (multilineList) {
@@ -185504,6 +185534,7 @@ ${e.message}`;
185504
185534
  changeAnyExtension: () => changeAnyExtension,
185505
185535
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
185506
185536
  changeExtension: () => changeExtension,
185537
+ changeFullExtension: () => changeFullExtension,
185507
185538
  changesAffectModuleResolution: () => changesAffectModuleResolution,
185508
185539
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
185509
185540
  childIsDecorated: () => childIsDecorated,
@@ -185943,6 +185974,7 @@ ${e.message}`;
185943
185974
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
185944
185975
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
185945
185976
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
185977
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
185946
185978
  getDeclarationFromName: () => getDeclarationFromName,
185947
185979
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
185948
185980
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -187924,6 +187956,7 @@ ${e.message}`;
187924
187956
  changeAnyExtension: () => changeAnyExtension,
187925
187957
  changeCompilerHostLikeToUseCache: () => changeCompilerHostLikeToUseCache,
187926
187958
  changeExtension: () => changeExtension,
187959
+ changeFullExtension: () => changeFullExtension,
187927
187960
  changesAffectModuleResolution: () => changesAffectModuleResolution,
187928
187961
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
187929
187962
  childIsDecorated: () => childIsDecorated,
@@ -188363,6 +188396,7 @@ ${e.message}`;
188363
188396
  getDeclarationEmitExtensionForPath: () => getDeclarationEmitExtensionForPath,
188364
188397
  getDeclarationEmitOutputFilePath: () => getDeclarationEmitOutputFilePath,
188365
188398
  getDeclarationEmitOutputFilePathWorker: () => getDeclarationEmitOutputFilePathWorker,
188399
+ getDeclarationFileExtension: () => getDeclarationFileExtension,
188366
188400
  getDeclarationFromName: () => getDeclarationFromName,
188367
188401
  getDeclarationModifierFlagsFromSymbol: () => getDeclarationModifierFlagsFromSymbol,
188368
188402
  getDeclarationOfKind: () => getDeclarationOfKind,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-insiders.20240102`;
57
+ var version = `${versionMajorMinor}.0-insiders.20240104`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -25616,7 +25616,25 @@ var IncrementalParser;
25616
25616
  })(InvalidPosition || (InvalidPosition = {}));
25617
25617
  })(IncrementalParser || (IncrementalParser = {}));
25618
25618
  function isDeclarationFileName(fileName) {
25619
- return fileExtensionIsOneOf(fileName, supportedDeclarationExtensions) || fileExtensionIs(fileName, ".ts" /* Ts */) && getBaseFileName(fileName).includes(".d.");
25619
+ return getDeclarationFileExtension(fileName) !== void 0;
25620
+ }
25621
+ function getDeclarationFileExtension(fileName) {
25622
+ const standardExtension = getAnyExtensionFromPath(
25623
+ fileName,
25624
+ supportedDeclarationExtensions,
25625
+ /*ignoreCase*/
25626
+ false
25627
+ );
25628
+ if (standardExtension) {
25629
+ return standardExtension;
25630
+ }
25631
+ if (fileExtensionIs(fileName, ".ts" /* Ts */)) {
25632
+ const index = getBaseFileName(fileName).lastIndexOf(".d.");
25633
+ if (index >= 0) {
25634
+ return fileName.substring(index);
25635
+ }
25636
+ }
25637
+ return void 0;
25620
25638
  }
25621
25639
  function parseResolutionMode(mode, pos, end, reportDiagnostic) {
25622
25640
  if (!mode) {
@@ -25914,6 +25932,7 @@ var libEntries = [
25914
25932
  ["es2022.regexp", "lib.es2022.regexp.d.ts"],
25915
25933
  ["es2023.array", "lib.es2023.array.d.ts"],
25916
25934
  ["es2023.collection", "lib.es2023.collection.d.ts"],
25935
+ ["es2023.intl", "lib.es2023.intl.d.ts"],
25917
25936
  ["esnext.array", "lib.es2023.array.d.ts"],
25918
25937
  ["esnext.collection", "lib.es2023.collection.d.ts"],
25919
25938
  ["esnext.symbol", "lib.es2019.symbol.d.ts"],
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.4.0-pr-56780-8",
5
+ "version": "5.4.0-pr-56902-8",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "a3e8fb1ca240be269ee36cd7368120195972a734"
117
+ "gitHead": "c379e13d533fa68cb366a822ad8455adfaf63ba7"
118
118
  }