@typescript-deploys/pr-build 5.1.0-pr-53487-5 → 5.1.0-pr-53489-6

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
@@ -53978,7 +53978,35 @@ function createTypeChecker(host) {
53978
53978
  return emptyArray;
53979
53979
  }
53980
53980
  function getSignaturesOfType(type, kind) {
53981
- return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
53981
+ const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
53982
+ if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
53983
+ if (type.arrayFallbackSignatures) {
53984
+ return type.arrayFallbackSignatures;
53985
+ }
53986
+ let memberName;
53987
+ if (everyType(type, (t) => {
53988
+ var _a2;
53989
+ return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
53990
+ })) {
53991
+ const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
53992
+ const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
53993
+ return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
53994
+ }
53995
+ type.arrayFallbackSignatures = result;
53996
+ }
53997
+ return result;
53998
+ }
53999
+ function isArrayOrTupleSymbol(symbol) {
54000
+ if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
54001
+ return false;
54002
+ }
54003
+ return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
54004
+ }
54005
+ function isReadonlyArraySymbol(symbol) {
54006
+ if (!symbol || !globalReadonlyArrayType.symbol) {
54007
+ return false;
54008
+ }
54009
+ return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
53982
54010
  }
53983
54011
  function findIndexInfo(indexInfos, keyType) {
53984
54012
  return find(indexInfos, (info) => info.keyType === keyType);
package/lib/tsserver.js CHANGED
@@ -58605,7 +58605,35 @@ function createTypeChecker(host) {
58605
58605
  return emptyArray;
58606
58606
  }
58607
58607
  function getSignaturesOfType(type, kind) {
58608
- return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
58608
+ const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
58609
+ if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
58610
+ if (type.arrayFallbackSignatures) {
58611
+ return type.arrayFallbackSignatures;
58612
+ }
58613
+ let memberName;
58614
+ if (everyType(type, (t) => {
58615
+ var _a2;
58616
+ return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
58617
+ })) {
58618
+ const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
58619
+ const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
58620
+ return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
58621
+ }
58622
+ type.arrayFallbackSignatures = result;
58623
+ }
58624
+ return result;
58625
+ }
58626
+ function isArrayOrTupleSymbol(symbol) {
58627
+ if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
58628
+ return false;
58629
+ }
58630
+ return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
58631
+ }
58632
+ function isReadonlyArraySymbol(symbol) {
58633
+ if (!symbol || !globalReadonlyArrayType.symbol) {
58634
+ return false;
58635
+ }
58636
+ return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
58609
58637
  }
58610
58638
  function findIndexInfo(indexInfos, keyType) {
58611
58639
  return find(indexInfos, (info) => info.keyType === keyType);
@@ -128759,13 +128787,7 @@ function findPrecedingToken(position, sourceFile, startNode2, excludeJsdoc) {
128759
128787
  sourceFile,
128760
128788
  n.kind
128761
128789
  );
128762
- if (candidate2) {
128763
- if (isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) {
128764
- return find2(candidate2);
128765
- }
128766
- return findRightmostToken(candidate2, sourceFile);
128767
- }
128768
- return void 0;
128790
+ return candidate2 && findRightmostToken(candidate2, sourceFile);
128769
128791
  } else {
128770
128792
  return find2(child);
128771
128793
  }
@@ -56413,7 +56413,35 @@ ${lanes.join("\n")}
56413
56413
  return emptyArray;
56414
56414
  }
56415
56415
  function getSignaturesOfType(type, kind) {
56416
- return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56416
+ const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56417
+ if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
56418
+ if (type.arrayFallbackSignatures) {
56419
+ return type.arrayFallbackSignatures;
56420
+ }
56421
+ let memberName;
56422
+ if (everyType(type, (t) => {
56423
+ var _a2;
56424
+ return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
56425
+ })) {
56426
+ const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
56427
+ const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
56428
+ return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
56429
+ }
56430
+ type.arrayFallbackSignatures = result;
56431
+ }
56432
+ return result;
56433
+ }
56434
+ function isArrayOrTupleSymbol(symbol) {
56435
+ if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
56436
+ return false;
56437
+ }
56438
+ return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56439
+ }
56440
+ function isReadonlyArraySymbol(symbol) {
56441
+ if (!symbol || !globalReadonlyArrayType.symbol) {
56442
+ return false;
56443
+ }
56444
+ return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56417
56445
  }
56418
56446
  function findIndexInfo(indexInfos, keyType) {
56419
56447
  return find(indexInfos, (info) => info.keyType === keyType);
@@ -127078,13 +127106,7 @@ ${lanes.join("\n")}
127078
127106
  sourceFile,
127079
127107
  n.kind
127080
127108
  );
127081
- if (candidate2) {
127082
- if (isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) {
127083
- return find2(candidate2);
127084
- }
127085
- return findRightmostToken(candidate2, sourceFile);
127086
- }
127087
- return void 0;
127109
+ return candidate2 && findRightmostToken(candidate2, sourceFile);
127088
127110
  } else {
127089
127111
  return find2(child);
127090
127112
  }
package/lib/typescript.js CHANGED
@@ -56413,7 +56413,35 @@ ${lanes.join("\n")}
56413
56413
  return emptyArray;
56414
56414
  }
56415
56415
  function getSignaturesOfType(type, kind) {
56416
- return getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56416
+ const result = getSignaturesOfStructuredType(getReducedApparentType(type), kind);
56417
+ if (kind === 0 /* Call */ && !length(result) && type.flags & 1048576 /* Union */) {
56418
+ if (type.arrayFallbackSignatures) {
56419
+ return type.arrayFallbackSignatures;
56420
+ }
56421
+ let memberName;
56422
+ if (everyType(type, (t) => {
56423
+ var _a2;
56424
+ return !!((_a2 = t.symbol) == null ? void 0 : _a2.parent) && isArrayOrTupleSymbol(t.symbol.parent) && (!memberName ? (memberName = t.symbol.escapedName, true) : memberName === t.symbol.escapedName);
56425
+ })) {
56426
+ const arrayArg = mapType(type, (t) => getMappedType((isReadonlyArraySymbol(t.symbol.parent) ? globalReadonlyArrayType : globalArrayType).typeParameters[0], t.mapper));
56427
+ const arrayType = createArrayType(arrayArg, someType(type, (t) => isReadonlyArraySymbol(t.symbol.parent)));
56428
+ return type.arrayFallbackSignatures = getSignaturesOfType(getTypeOfPropertyOfType(arrayType, memberName), kind);
56429
+ }
56430
+ type.arrayFallbackSignatures = result;
56431
+ }
56432
+ return result;
56433
+ }
56434
+ function isArrayOrTupleSymbol(symbol) {
56435
+ if (!symbol || !globalArrayType.symbol || !globalReadonlyArrayType.symbol) {
56436
+ return false;
56437
+ }
56438
+ return !!getSymbolIfSameReference(symbol, globalArrayType.symbol) || !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56439
+ }
56440
+ function isReadonlyArraySymbol(symbol) {
56441
+ if (!symbol || !globalReadonlyArrayType.symbol) {
56442
+ return false;
56443
+ }
56444
+ return !!getSymbolIfSameReference(symbol, globalReadonlyArrayType.symbol);
56417
56445
  }
56418
56446
  function findIndexInfo(indexInfos, keyType) {
56419
56447
  return find(indexInfos, (info) => info.keyType === keyType);
@@ -127092,13 +127120,7 @@ ${lanes.join("\n")}
127092
127120
  sourceFile,
127093
127121
  n.kind
127094
127122
  );
127095
- if (candidate2) {
127096
- if (isJSDocCommentContainingNode(candidate2) && candidate2.getChildren(sourceFile).length) {
127097
- return find2(candidate2);
127098
- }
127099
- return findRightmostToken(candidate2, sourceFile);
127100
- }
127101
- return void 0;
127123
+ return candidate2 && findRightmostToken(candidate2, sourceFile);
127102
127124
  } else {
127103
127125
  return find2(child);
127104
127126
  }
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.1.0-pr-53487-5",
5
+ "version": "5.1.0-pr-53489-6",
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": "14.21.1",
115
115
  "npm": "8.19.3"
116
116
  },
117
- "gitHead": "7685ef5dcb0017eda471fd0cfbc7b8cb8494c789"
117
+ "gitHead": "f71c3a89332bad335839d084408978a70aa8991d"
118
118
  }