typescript 5.1.0-dev.20230309 → 5.1.0-dev.20230310

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.
@@ -20,6 +20,27 @@ and limitations under the License.
20
20
  /// Worker Iterable APIs
21
21
  /////////////////////////////
22
22
 
23
+ interface CSSNumericArray {
24
+ [Symbol.iterator](): IterableIterator<CSSNumericValue>;
25
+ entries(): IterableIterator<[number, CSSNumericValue]>;
26
+ keys(): IterableIterator<number>;
27
+ values(): IterableIterator<CSSNumericValue>;
28
+ }
29
+
30
+ interface CSSTransformValue {
31
+ [Symbol.iterator](): IterableIterator<CSSTransformComponent>;
32
+ entries(): IterableIterator<[number, CSSTransformComponent]>;
33
+ keys(): IterableIterator<number>;
34
+ values(): IterableIterator<CSSTransformComponent>;
35
+ }
36
+
37
+ interface CSSUnparsedValue {
38
+ [Symbol.iterator](): IterableIterator<CSSUnparsedSegment>;
39
+ entries(): IterableIterator<[number, CSSUnparsedSegment]>;
40
+ keys(): IterableIterator<number>;
41
+ values(): IterableIterator<CSSUnparsedSegment>;
42
+ }
43
+
23
44
  interface Cache {
24
45
  addAll(requests: Iterable<RequestInfo>): Promise<void>;
25
46
  }
@@ -82,6 +103,13 @@ interface MessageEvent<T = any> {
82
103
  initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
83
104
  }
84
105
 
106
+ interface StylePropertyMapReadOnly {
107
+ [Symbol.iterator](): IterableIterator<[string, Iterable<CSSStyleValue>]>;
108
+ entries(): IterableIterator<[string, Iterable<CSSStyleValue>]>;
109
+ keys(): IterableIterator<string>;
110
+ values(): IterableIterator<Iterable<CSSStyleValue>>;
111
+ }
112
+
85
113
  interface SubtleCrypto {
86
114
  deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
87
115
  generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
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.1";
26
- var version = `${versionMajorMinor}.0-dev.20230309`;
26
+ var version = `${versionMajorMinor}.0-dev.20230310`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -4876,20 +4876,6 @@ function patchWriteFileEnsuringDirectory(sys2) {
4876
4876
  (path2) => sys2.directoryExists(path2)
4877
4877
  );
4878
4878
  }
4879
- function getNodeMajorVersion() {
4880
- if (typeof process === "undefined") {
4881
- return void 0;
4882
- }
4883
- const version2 = process.version;
4884
- if (!version2) {
4885
- return void 0;
4886
- }
4887
- const dot = version2.indexOf(".");
4888
- if (dot === -1) {
4889
- return void 0;
4890
- }
4891
- return parseInt(version2.substring(1, dot));
4892
- }
4893
4879
  var sys = (() => {
4894
4880
  const byteOrderMarkIndicator = "\uFEFF";
4895
4881
  function getNodeSystem() {
@@ -4906,14 +4892,12 @@ var sys = (() => {
4906
4892
  let activeSession;
4907
4893
  let profilePath = "./profile.cpuprofile";
4908
4894
  const Buffer2 = require("buffer").Buffer;
4909
- const nodeVersion = getNodeMajorVersion();
4910
- const isNode4OrLater = nodeVersion >= 4;
4911
4895
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
4912
4896
  const platform = _os.platform();
4913
4897
  const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
4914
4898
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4915
4899
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
4916
- const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
4900
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
4917
4901
  const getCurrentDirectory = memoize(() => process.cwd());
4918
4902
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
4919
4903
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -52679,10 +52663,9 @@ function createTypeChecker(host) {
52679
52663
  return [sig.parameters];
52680
52664
  function expandSignatureParametersWithTupleMembers(restType, restIndex) {
52681
52665
  const elementTypes = getTypeArguments(restType);
52682
- const associatedNames = restType.target.labeledElementDeclarations;
52666
+ const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
52683
52667
  const restParams = map(elementTypes, (t, i) => {
52684
- const tupleLabelName = !!associatedNames && getTupleElementLabel(associatedNames[i]);
52685
- const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
52668
+ const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
52686
52669
  const flags = restType.target.elementFlags[i];
52687
52670
  const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
52688
52671
  const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
@@ -52691,6 +52674,20 @@ function createTypeChecker(host) {
52691
52674
  });
52692
52675
  return concatenate(sig.parameters.slice(0, restIndex), restParams);
52693
52676
  }
52677
+ function getUniqAssociatedNamesFromTupleType(type) {
52678
+ const associatedNamesMap = /* @__PURE__ */ new Map();
52679
+ return map(type.target.labeledElementDeclarations, (labeledElement) => {
52680
+ const name = getTupleElementLabel(labeledElement);
52681
+ const prevCounter = associatedNamesMap.get(name);
52682
+ if (prevCounter === void 0) {
52683
+ associatedNamesMap.set(name, 1);
52684
+ return name;
52685
+ } else {
52686
+ associatedNamesMap.set(name, prevCounter + 1);
52687
+ return `${name}_${prevCounter}`;
52688
+ }
52689
+ });
52690
+ }
52694
52691
  }
52695
52692
  function getDefaultConstructSignatures(classType) {
52696
52693
  const baseConstructorType = getBaseConstructorTypeOfClass(classType);
package/lib/tsserver.js CHANGED
@@ -883,7 +883,6 @@ __export(server_exports, {
883
883
  getNodeForGeneratedName: () => getNodeForGeneratedName,
884
884
  getNodeId: () => getNodeId,
885
885
  getNodeKind: () => getNodeKind,
886
- getNodeMajorVersion: () => getNodeMajorVersion,
887
886
  getNodeModifiers: () => getNodeModifiers,
888
887
  getNodeModulePathParts: () => getNodeModulePathParts,
889
888
  getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
@@ -2285,7 +2284,7 @@ module.exports = __toCommonJS(server_exports);
2285
2284
 
2286
2285
  // src/compiler/corePublic.ts
2287
2286
  var versionMajorMinor = "5.1";
2288
- var version = `${versionMajorMinor}.0-dev.20230309`;
2287
+ var version = `${versionMajorMinor}.0-dev.20230310`;
2289
2288
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2289
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2290
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -8315,20 +8314,6 @@ function patchWriteFileEnsuringDirectory(sys2) {
8315
8314
  (path2) => sys2.directoryExists(path2)
8316
8315
  );
8317
8316
  }
8318
- function getNodeMajorVersion() {
8319
- if (typeof process === "undefined") {
8320
- return void 0;
8321
- }
8322
- const version2 = process.version;
8323
- if (!version2) {
8324
- return void 0;
8325
- }
8326
- const dot = version2.indexOf(".");
8327
- if (dot === -1) {
8328
- return void 0;
8329
- }
8330
- return parseInt(version2.substring(1, dot));
8331
- }
8332
8317
  var sys = (() => {
8333
8318
  const byteOrderMarkIndicator = "\uFEFF";
8334
8319
  function getNodeSystem() {
@@ -8345,14 +8330,12 @@ var sys = (() => {
8345
8330
  let activeSession;
8346
8331
  let profilePath = "./profile.cpuprofile";
8347
8332
  const Buffer2 = require("buffer").Buffer;
8348
- const nodeVersion = getNodeMajorVersion();
8349
- const isNode4OrLater = nodeVersion >= 4;
8350
8333
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
8351
8334
  const platform = _os.platform();
8352
8335
  const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
8353
8336
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
8354
8337
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
8355
- const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
8338
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
8356
8339
  const getCurrentDirectory = memoize(() => process.cwd());
8357
8340
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
8358
8341
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -57269,10 +57252,9 @@ function createTypeChecker(host) {
57269
57252
  return [sig.parameters];
57270
57253
  function expandSignatureParametersWithTupleMembers(restType, restIndex) {
57271
57254
  const elementTypes = getTypeArguments(restType);
57272
- const associatedNames = restType.target.labeledElementDeclarations;
57255
+ const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
57273
57256
  const restParams = map(elementTypes, (t, i) => {
57274
- const tupleLabelName = !!associatedNames && getTupleElementLabel(associatedNames[i]);
57275
- const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
57257
+ const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
57276
57258
  const flags = restType.target.elementFlags[i];
57277
57259
  const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
57278
57260
  const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
@@ -57281,6 +57263,20 @@ function createTypeChecker(host) {
57281
57263
  });
57282
57264
  return concatenate(sig.parameters.slice(0, restIndex), restParams);
57283
57265
  }
57266
+ function getUniqAssociatedNamesFromTupleType(type) {
57267
+ const associatedNamesMap = /* @__PURE__ */ new Map();
57268
+ return map(type.target.labeledElementDeclarations, (labeledElement) => {
57269
+ const name = getTupleElementLabel(labeledElement);
57270
+ const prevCounter = associatedNamesMap.get(name);
57271
+ if (prevCounter === void 0) {
57272
+ associatedNamesMap.set(name, 1);
57273
+ return name;
57274
+ } else {
57275
+ associatedNamesMap.set(name, prevCounter + 1);
57276
+ return `${name}_${prevCounter}`;
57277
+ }
57278
+ });
57279
+ }
57284
57280
  }
57285
57281
  function getDefaultConstructSignatures(classType) {
57286
57282
  const baseConstructorType = getBaseConstructorTypeOfClass(classType);
@@ -143985,9 +143981,10 @@ function getInfo7(sourceFile, tokenPos, errorCode, checker, program) {
143985
143981
  if (!isMemberName(token))
143986
143982
  return void 0;
143987
143983
  if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
143984
+ const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token);
143988
143985
  const properties = arrayFrom(checker.getUnmatchedProperties(
143989
143986
  checker.getTypeAtLocation(parent2.initializer),
143990
- checker.getTypeAtLocation(token),
143987
+ targetType,
143991
143988
  /* requireOptionalProperties */
143992
143989
  false,
143993
143990
  /* matchDiscriminantProperties */
@@ -168867,7 +168864,6 @@ __export(ts_exports3, {
168867
168864
  getNodeForGeneratedName: () => getNodeForGeneratedName,
168868
168865
  getNodeId: () => getNodeId,
168869
168866
  getNodeKind: () => getNodeKind,
168870
- getNodeMajorVersion: () => getNodeMajorVersion,
168871
168867
  getNodeModifiers: () => getNodeModifiers,
168872
168868
  getNodeModulePathParts: () => getNodeModulePathParts,
168873
168869
  getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
@@ -181393,8 +181389,7 @@ function initializeNodeSystem() {
181393
181389
  }
181394
181390
  }
181395
181391
  const libDirectory = getDirectoryPath(normalizePath(sys2.getExecutingFilePath()));
181396
- const nodeVersion = getNodeMajorVersion();
181397
- const useWatchGuard = process.platform === "win32" && nodeVersion >= 4;
181392
+ const useWatchGuard = process.platform === "win32";
181398
181393
  const originalWatchDirectory = sys2.watchDirectory.bind(sys2);
181399
181394
  const logger = createLogger();
181400
181395
  Debug.loggingHost = {
@@ -181949,7 +181944,7 @@ function start({ args, logger, cancellationToken, serverMode, unknownServerMode,
181949
181944
  logger.info(`Starting TS Server`);
181950
181945
  logger.info(`Version: ${version}`);
181951
181946
  logger.info(`Arguments: ${args.join(" ")}`);
181952
- logger.info(`Platform: ${platform} NodeVersion: ${getNodeMajorVersion()} CaseSensitive: ${sys.useCaseSensitiveFileNames}`);
181947
+ logger.info(`Platform: ${platform} NodeVersion: ${process.version} CaseSensitive: ${sys.useCaseSensitiveFileNames}`);
181953
181948
  logger.info(`ServerMode: ${serverMode} hasUnknownServerMode: ${unknownServerMode}`);
181954
181949
  setStackTraceLimit();
181955
181950
  if (Debug.isDebugging) {
@@ -182827,7 +182822,6 @@ start(initializeNodeSystem(), require("os").platform());
182827
182822
  getNodeForGeneratedName,
182828
182823
  getNodeId,
182829
182824
  getNodeKind,
182830
- getNodeMajorVersion,
182831
182825
  getNodeModifiers,
182832
182826
  getNodeModulePathParts,
182833
182827
  getNonAssignedNameOfDeclaration,
@@ -8285,7 +8285,6 @@ declare namespace ts {
8285
8285
  negative: boolean;
8286
8286
  base10Value: string;
8287
8287
  }
8288
- function getNodeMajorVersion(): number | undefined;
8289
8288
  enum FileWatcherEventKind {
8290
8289
  Created = 0,
8291
8290
  Changed = 1,
@@ -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.20230309`;
38
+ version = `${versionMajorMinor}.0-dev.20230310`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6098,20 +6098,6 @@ ${lanes.join("\n")}
6098
6098
  (path2) => sys2.directoryExists(path2)
6099
6099
  );
6100
6100
  }
6101
- function getNodeMajorVersion() {
6102
- if (typeof process === "undefined") {
6103
- return void 0;
6104
- }
6105
- const version2 = process.version;
6106
- if (!version2) {
6107
- return void 0;
6108
- }
6109
- const dot = version2.indexOf(".");
6110
- if (dot === -1) {
6111
- return void 0;
6112
- }
6113
- return parseInt(version2.substring(1, dot));
6114
- }
6115
6101
  function setSys(s) {
6116
6102
  sys = s;
6117
6103
  }
@@ -6159,14 +6145,12 @@ ${lanes.join("\n")}
6159
6145
  let activeSession;
6160
6146
  let profilePath = "./profile.cpuprofile";
6161
6147
  const Buffer2 = require("buffer").Buffer;
6162
- const nodeVersion = getNodeMajorVersion();
6163
- const isNode4OrLater = nodeVersion >= 4;
6164
6148
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
6165
6149
  const platform = _os.platform();
6166
6150
  const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
6167
6151
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
6168
6152
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
6169
- const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
6153
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
6170
6154
  const getCurrentDirectory = memoize(() => process.cwd());
6171
6155
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
6172
6156
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -55080,10 +55064,9 @@ ${lanes.join("\n")}
55080
55064
  return [sig.parameters];
55081
55065
  function expandSignatureParametersWithTupleMembers(restType, restIndex) {
55082
55066
  const elementTypes = getTypeArguments(restType);
55083
- const associatedNames = restType.target.labeledElementDeclarations;
55067
+ const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
55084
55068
  const restParams = map(elementTypes, (t, i) => {
55085
- const tupleLabelName = !!associatedNames && getTupleElementLabel(associatedNames[i]);
55086
- const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
55069
+ const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
55087
55070
  const flags = restType.target.elementFlags[i];
55088
55071
  const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
55089
55072
  const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
@@ -55092,6 +55075,20 @@ ${lanes.join("\n")}
55092
55075
  });
55093
55076
  return concatenate(sig.parameters.slice(0, restIndex), restParams);
55094
55077
  }
55078
+ function getUniqAssociatedNamesFromTupleType(type) {
55079
+ const associatedNamesMap = /* @__PURE__ */ new Map();
55080
+ return map(type.target.labeledElementDeclarations, (labeledElement) => {
55081
+ const name = getTupleElementLabel(labeledElement);
55082
+ const prevCounter = associatedNamesMap.get(name);
55083
+ if (prevCounter === void 0) {
55084
+ associatedNamesMap.set(name, 1);
55085
+ return name;
55086
+ } else {
55087
+ associatedNamesMap.set(name, prevCounter + 1);
55088
+ return `${name}_${prevCounter}`;
55089
+ }
55090
+ });
55091
+ }
55095
55092
  }
55096
55093
  function getDefaultConstructSignatures(classType) {
55097
55094
  const baseConstructorType = getBaseConstructorTypeOfClass(classType);
@@ -142576,9 +142573,10 @@ ${lanes.join("\n")}
142576
142573
  if (!isMemberName(token))
142577
142574
  return void 0;
142578
142575
  if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
142576
+ const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token);
142579
142577
  const properties = arrayFrom(checker.getUnmatchedProperties(
142580
142578
  checker.getTypeAtLocation(parent2.initializer),
142581
- checker.getTypeAtLocation(token),
142579
+ targetType,
142582
142580
  /* requireOptionalProperties */
142583
142581
  false,
142584
142582
  /* matchDiscriminantProperties */
@@ -179476,7 +179474,6 @@ ${e.message}`;
179476
179474
  getNodeForGeneratedName: () => getNodeForGeneratedName,
179477
179475
  getNodeId: () => getNodeId,
179478
179476
  getNodeKind: () => getNodeKind,
179479
- getNodeMajorVersion: () => getNodeMajorVersion,
179480
179477
  getNodeModifiers: () => getNodeModifiers,
179481
179478
  getNodeModulePathParts: () => getNodeModulePathParts,
179482
179479
  getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
@@ -181833,7 +181830,6 @@ ${e.message}`;
181833
181830
  getNodeForGeneratedName: () => getNodeForGeneratedName,
181834
181831
  getNodeId: () => getNodeId,
181835
181832
  getNodeKind: () => getNodeKind,
181836
- getNodeMajorVersion: () => getNodeMajorVersion,
181837
181833
  getNodeModifiers: () => getNodeModifiers,
181838
181834
  getNodeModulePathParts: () => getNodeModulePathParts,
181839
181835
  getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
@@ -4342,7 +4342,6 @@ declare namespace ts {
4342
4342
  negative: boolean;
4343
4343
  base10Value: string;
4344
4344
  }
4345
- function getNodeMajorVersion(): number | undefined;
4346
4345
  enum FileWatcherEventKind {
4347
4346
  Created = 0,
4348
4347
  Changed = 1,
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.20230309`;
38
+ version = `${versionMajorMinor}.0-dev.20230310`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6098,20 +6098,6 @@ ${lanes.join("\n")}
6098
6098
  (path2) => sys2.directoryExists(path2)
6099
6099
  );
6100
6100
  }
6101
- function getNodeMajorVersion() {
6102
- if (typeof process === "undefined") {
6103
- return void 0;
6104
- }
6105
- const version2 = process.version;
6106
- if (!version2) {
6107
- return void 0;
6108
- }
6109
- const dot = version2.indexOf(".");
6110
- if (dot === -1) {
6111
- return void 0;
6112
- }
6113
- return parseInt(version2.substring(1, dot));
6114
- }
6115
6101
  function setSys(s) {
6116
6102
  sys = s;
6117
6103
  }
@@ -6159,14 +6145,12 @@ ${lanes.join("\n")}
6159
6145
  let activeSession;
6160
6146
  let profilePath = "./profile.cpuprofile";
6161
6147
  const Buffer2 = require("buffer").Buffer;
6162
- const nodeVersion = getNodeMajorVersion();
6163
- const isNode4OrLater = nodeVersion >= 4;
6164
6148
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
6165
6149
  const platform = _os.platform();
6166
6150
  const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
6167
6151
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
6168
6152
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
6169
- const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
6153
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
6170
6154
  const getCurrentDirectory = memoize(() => process.cwd());
6171
6155
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
6172
6156
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -55080,10 +55064,9 @@ ${lanes.join("\n")}
55080
55064
  return [sig.parameters];
55081
55065
  function expandSignatureParametersWithTupleMembers(restType, restIndex) {
55082
55066
  const elementTypes = getTypeArguments(restType);
55083
- const associatedNames = restType.target.labeledElementDeclarations;
55067
+ const associatedNames = getUniqAssociatedNamesFromTupleType(restType);
55084
55068
  const restParams = map(elementTypes, (t, i) => {
55085
- const tupleLabelName = !!associatedNames && getTupleElementLabel(associatedNames[i]);
55086
- const name = tupleLabelName || getParameterNameAtPosition(sig, restIndex + i, restType);
55069
+ const name = associatedNames && associatedNames[i] ? associatedNames[i] : getParameterNameAtPosition(sig, restIndex + i, restType);
55087
55070
  const flags = restType.target.elementFlags[i];
55088
55071
  const checkFlags = flags & 12 /* Variable */ ? 32768 /* RestParameter */ : flags & 2 /* Optional */ ? 16384 /* OptionalParameter */ : 0;
55089
55072
  const symbol = createSymbol(1 /* FunctionScopedVariable */, name, checkFlags);
@@ -55092,6 +55075,20 @@ ${lanes.join("\n")}
55092
55075
  });
55093
55076
  return concatenate(sig.parameters.slice(0, restIndex), restParams);
55094
55077
  }
55078
+ function getUniqAssociatedNamesFromTupleType(type) {
55079
+ const associatedNamesMap = /* @__PURE__ */ new Map();
55080
+ return map(type.target.labeledElementDeclarations, (labeledElement) => {
55081
+ const name = getTupleElementLabel(labeledElement);
55082
+ const prevCounter = associatedNamesMap.get(name);
55083
+ if (prevCounter === void 0) {
55084
+ associatedNamesMap.set(name, 1);
55085
+ return name;
55086
+ } else {
55087
+ associatedNamesMap.set(name, prevCounter + 1);
55088
+ return `${name}_${prevCounter}`;
55089
+ }
55090
+ });
55091
+ }
55095
55092
  }
55096
55093
  function getDefaultConstructSignatures(classType) {
55097
55094
  const baseConstructorType = getBaseConstructorTypeOfClass(classType);
@@ -142590,9 +142587,10 @@ ${lanes.join("\n")}
142590
142587
  if (!isMemberName(token))
142591
142588
  return void 0;
142592
142589
  if (isIdentifier(token) && hasInitializer(parent2) && parent2.initializer && isObjectLiteralExpression(parent2.initializer)) {
142590
+ const targetType = checker.getContextualType(token) || checker.getTypeAtLocation(token);
142593
142591
  const properties = arrayFrom(checker.getUnmatchedProperties(
142594
142592
  checker.getTypeAtLocation(parent2.initializer),
142595
- checker.getTypeAtLocation(token),
142593
+ targetType,
142596
142594
  /* requireOptionalProperties */
142597
142595
  false,
142598
142596
  /* matchDiscriminantProperties */
@@ -168644,7 +168642,6 @@ ${options.prefix}` : "\n" : options.prefix
168644
168642
  getNodeForGeneratedName: () => getNodeForGeneratedName,
168645
168643
  getNodeId: () => getNodeId,
168646
168644
  getNodeKind: () => getNodeKind,
168647
- getNodeMajorVersion: () => getNodeMajorVersion,
168648
168645
  getNodeModifiers: () => getNodeModifiers,
168649
168646
  getNodeModulePathParts: () => getNodeModulePathParts,
168650
168647
  getNonAssignedNameOfDeclaration: () => getNonAssignedNameOfDeclaration,
@@ -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.20230309`;
57
+ var version = `${versionMajorMinor}.0-dev.20230310`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -4264,20 +4264,6 @@ function patchWriteFileEnsuringDirectory(sys2) {
4264
4264
  (path3) => sys2.directoryExists(path3)
4265
4265
  );
4266
4266
  }
4267
- function getNodeMajorVersion() {
4268
- if (typeof process === "undefined") {
4269
- return void 0;
4270
- }
4271
- const version2 = process.version;
4272
- if (!version2) {
4273
- return void 0;
4274
- }
4275
- const dot = version2.indexOf(".");
4276
- if (dot === -1) {
4277
- return void 0;
4278
- }
4279
- return parseInt(version2.substring(1, dot));
4280
- }
4281
4267
  var sys = (() => {
4282
4268
  const byteOrderMarkIndicator = "\uFEFF";
4283
4269
  function getNodeSystem() {
@@ -4294,14 +4280,12 @@ var sys = (() => {
4294
4280
  let activeSession;
4295
4281
  let profilePath = "./profile.cpuprofile";
4296
4282
  const Buffer2 = require("buffer").Buffer;
4297
- const nodeVersion = getNodeMajorVersion();
4298
- const isNode4OrLater = nodeVersion >= 4;
4299
4283
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
4300
4284
  const platform = _os.platform();
4301
4285
  const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
4302
4286
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4303
4287
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
4304
- const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
4288
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
4305
4289
  const getCurrentDirectory = memoize(() => process.cwd());
4306
4290
  const { watchFile, watchDirectory } = createSystemWatchFunctions({
4307
4291
  pollingWatchFileWorker: fsWatchFileWorker,
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.20230309",
5
+ "version": "5.1.0-dev.20230310",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -26,7 +26,7 @@
26
26
  "tsserver": "./bin/tsserver"
27
27
  },
28
28
  "engines": {
29
- "node": ">=4.2.0"
29
+ "node": ">=12.20"
30
30
  },
31
31
  "files": [
32
32
  "bin",
@@ -112,5 +112,5 @@
112
112
  "node": "14.21.1",
113
113
  "npm": "8.19.3"
114
114
  },
115
- "gitHead": "d681520a14edf78560de2b098d6d68783e2fdd8d"
115
+ "gitHead": "a8ffab2f30074b8135c978851e8bf8146dfd3239"
116
116
  }