File tree 1 file changed +18
-15
lines changed
1 file changed +18
-15
lines changed Original file line number Original file line Diff line number Diff line change @@ -4948,24 +4948,27 @@ namespace ts {
4948
}
4948
}
4949
4949
4950
function getTypeListId(types: Type[]) {
4950
function getTypeListId(types: Type[]) {
4951
+ let result = "";
4951
if (types) {
4952
if (types) {
4952
- switch (types.length) {
4953
+ const length = types.length;
4953
- case 1:
4954
+ let i = 0;
4954
- return "" + types[0].id;
4955
+ while (i < length) {
4955
- case 2:
4956
+ const startId = types[i].id;
4956
- return types[0].id + "," + types[1].id;
4957
+ let count = 1;
4957
- default:
4958
+ while (i + count < length && types[i + count].id === startId + count) {
4958
- let result = "";
4959
+ count++;
4959
- for (let i = 0; i < types.length; i++) {
4960
+ }
4960
- if (i > 0) {
4961
+ if (result.length) {
4961
- result += ",";
4962
+ result += ",";
4962
- }
4963
+ }
4963
- result += types[i].id;
4964
+ result += startId;
4964
- }
4965
+ if (count > 1) {
4965
- return result;
4966
+ result += ":" + count;
4967
+ }
4968
+ i += count;
4966
}
4969
}
4967
}
4970
}
4968
- return "" ;
4971
+ return result ;
4969
}
4972
}
4970
4973
4971
// This function is used to propagate certain flags when creating new object type references and union types.
4974
// This function is used to propagate certain flags when creating new object type references and union types.
You can’t perform that action at this time.
0 commit comments