tstyche 6.0.0-beta.4 → 6.0.0-beta.5
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/dist/tstyche.js +35 -23
- package/package.json +1 -1
package/dist/tstyche.js
CHANGED
|
@@ -4550,9 +4550,6 @@ class ToAcceptProps {
|
|
|
4550
4550
|
}
|
|
4551
4551
|
}
|
|
4552
4552
|
|
|
4553
|
-
function ensureArray(input) {
|
|
4554
|
-
return input ?? [];
|
|
4555
|
-
}
|
|
4556
4553
|
function getIndexSignatures(type, compiler, typeChecker) {
|
|
4557
4554
|
if (type.flags & compiler.TypeFlags.Intersection) {
|
|
4558
4555
|
return type.types.flatMap((type) => getIndexSignatures(type, compiler, typeChecker));
|
|
@@ -4565,6 +4562,12 @@ function getSignatures(type, kind, compiler, typeChecker) {
|
|
|
4565
4562
|
}
|
|
4566
4563
|
return typeChecker.getSignaturesOfType(type, kind);
|
|
4567
4564
|
}
|
|
4565
|
+
function getThisTypeOfSignature(signature, typeChecker) {
|
|
4566
|
+
return signature.thisParameter && typeChecker.getTypeOfSymbol(signature.thisParameter);
|
|
4567
|
+
}
|
|
4568
|
+
function getTypeParametersOfSignature(signature) {
|
|
4569
|
+
return signature.typeParameters ?? [];
|
|
4570
|
+
}
|
|
4568
4571
|
function getTypeParameterModifiers(typeParameter, compiler) {
|
|
4569
4572
|
if (!typeParameter.symbol.declarations) {
|
|
4570
4573
|
return compiler.ModifierFlags.None;
|
|
@@ -4583,9 +4586,6 @@ function isCheckFlagSet(symbol, flag, compiler) {
|
|
|
4583
4586
|
function isSymbolFromDefaultLibrary(symbol, program) {
|
|
4584
4587
|
return !!symbol.declarations?.every((declaration) => program.isSourceFileDefaultLibrary(declaration.getSourceFile()));
|
|
4585
4588
|
}
|
|
4586
|
-
function length(array) {
|
|
4587
|
-
return array?.length ?? 0;
|
|
4588
|
-
}
|
|
4589
4589
|
|
|
4590
4590
|
function getParameterFactsFromTuple(type, position, compiler) {
|
|
4591
4591
|
return {
|
|
@@ -4688,11 +4688,6 @@ class Structure {
|
|
|
4688
4688
|
}
|
|
4689
4689
|
return !a && !b;
|
|
4690
4690
|
}
|
|
4691
|
-
#compareTypeOfSymbol(a, b) {
|
|
4692
|
-
const aTypeOfSymbol = a && this.#typeChecker.getTypeOfSymbol(a);
|
|
4693
|
-
const bTypeOfSymbol = b && this.#typeChecker.getTypeOfSymbol(b);
|
|
4694
|
-
return this.#compareMaybeNullish(aTypeOfSymbol, bTypeOfSymbol);
|
|
4695
|
-
}
|
|
4696
4691
|
compare(a, b) {
|
|
4697
4692
|
a = this.#normalize(a);
|
|
4698
4693
|
b = this.#normalize(b);
|
|
@@ -4762,6 +4757,12 @@ class Structure {
|
|
|
4762
4757
|
}
|
|
4763
4758
|
return false;
|
|
4764
4759
|
}
|
|
4760
|
+
if ((a.flags | b.flags) & this.#compiler.TypeFlags.StringMapping) {
|
|
4761
|
+
if (a.flags & b.flags & this.#compiler.TypeFlags.StringMapping) {
|
|
4762
|
+
return this.compareStringMappingTypes(a, b);
|
|
4763
|
+
}
|
|
4764
|
+
return false;
|
|
4765
|
+
}
|
|
4765
4766
|
return false;
|
|
4766
4767
|
}
|
|
4767
4768
|
compareIntersections(a, b) {
|
|
@@ -4795,16 +4796,18 @@ class Structure {
|
|
|
4795
4796
|
if ((a.objectFlags | b.objectFlags) & this.#compiler.ObjectFlags.Class) {
|
|
4796
4797
|
return this.compareStructuredTypes(a, b);
|
|
4797
4798
|
}
|
|
4798
|
-
if (
|
|
4799
|
+
if (a.symbol !== b.symbol) {
|
|
4799
4800
|
if (isSymbolFromDefaultLibrary(a.symbol, this.#program) || isSymbolFromDefaultLibrary(b.symbol, this.#program)) {
|
|
4800
4801
|
return false;
|
|
4801
4802
|
}
|
|
4802
4803
|
return;
|
|
4803
4804
|
}
|
|
4804
|
-
|
|
4805
|
+
const aTypeArguments = this.#typeChecker.getTypeArguments(a);
|
|
4806
|
+
const bTypeArguments = this.#typeChecker.getTypeArguments(b);
|
|
4807
|
+
if (aTypeArguments.length !== bTypeArguments.length) {
|
|
4805
4808
|
return false;
|
|
4806
4809
|
}
|
|
4807
|
-
return
|
|
4810
|
+
return aTypeArguments.every((type, i) => this.compare(type, bTypeArguments[i]));
|
|
4808
4811
|
}
|
|
4809
4812
|
compareTuples(a, b) {
|
|
4810
4813
|
if (a.target.readonly !== b.target.readonly) {
|
|
@@ -4812,7 +4815,7 @@ class Structure {
|
|
|
4812
4815
|
}
|
|
4813
4816
|
const aTypeArguments = this.#typeChecker.getTypeArguments(a);
|
|
4814
4817
|
const bTypeArguments = this.#typeChecker.getTypeArguments(b);
|
|
4815
|
-
if (length
|
|
4818
|
+
if (aTypeArguments.length !== bTypeArguments.length) {
|
|
4816
4819
|
return false;
|
|
4817
4820
|
}
|
|
4818
4821
|
for (let i = 0; i < aTypeArguments.length; i++) {
|
|
@@ -4894,17 +4897,17 @@ class Structure {
|
|
|
4894
4897
|
return true;
|
|
4895
4898
|
}
|
|
4896
4899
|
#compareSignature(a, b) {
|
|
4897
|
-
|
|
4900
|
+
const aTypeParameters = getTypeParametersOfSignature(a);
|
|
4901
|
+
const bTypeParameters = getTypeParametersOfSignature(b);
|
|
4902
|
+
if (aTypeParameters.length !== bTypeParameters.length) {
|
|
4898
4903
|
return false;
|
|
4899
4904
|
}
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
return false;
|
|
4904
|
-
}
|
|
4905
|
+
for (let i = 0; i < aTypeParameters.length; i++) {
|
|
4906
|
+
if (!this.compareTypeParameters(aTypeParameters[i], bTypeParameters[i])) {
|
|
4907
|
+
return false;
|
|
4905
4908
|
}
|
|
4906
4909
|
}
|
|
4907
|
-
if (!this.#
|
|
4910
|
+
if (!this.#compareMaybeNullish(getThisTypeOfSignature(a, this.#typeChecker), getThisTypeOfSignature(b, this.#typeChecker))) {
|
|
4908
4911
|
return false;
|
|
4909
4912
|
}
|
|
4910
4913
|
if (!this.compareParameters(a, b)) {
|
|
@@ -5020,6 +5023,15 @@ class Structure {
|
|
|
5020
5023
|
}
|
|
5021
5024
|
return true;
|
|
5022
5025
|
}
|
|
5026
|
+
compareStringMappingTypes(a, b) {
|
|
5027
|
+
if (a.symbol !== b.symbol) {
|
|
5028
|
+
return false;
|
|
5029
|
+
}
|
|
5030
|
+
if (!this.compare(a.type, b.type)) {
|
|
5031
|
+
return false;
|
|
5032
|
+
}
|
|
5033
|
+
return true;
|
|
5034
|
+
}
|
|
5023
5035
|
#normalize(type) {
|
|
5024
5036
|
if (type.flags & this.#compiler.TypeFlags.Freshable && type.freshType === type) {
|
|
5025
5037
|
return type.regularType;
|
|
@@ -5888,7 +5900,7 @@ class FileRunner {
|
|
|
5888
5900
|
class Runner {
|
|
5889
5901
|
#eventEmitter = new EventEmitter();
|
|
5890
5902
|
#resolvedConfig;
|
|
5891
|
-
static version = "6.0.0-beta.
|
|
5903
|
+
static version = "6.0.0-beta.5";
|
|
5892
5904
|
constructor(resolvedConfig) {
|
|
5893
5905
|
this.#resolvedConfig = resolvedConfig;
|
|
5894
5906
|
}
|