tstyche 6.0.0 → 6.0.1

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/README.md CHANGED
@@ -100,4 +100,4 @@ Visit [tstyche.org](https://tstyche.org) to view the full documentation.
100
100
  [coverage-badge]: https://badgen.net/codacy/coverage/a581ca5c323a455886b7bdd9623c4ec8
101
101
  [coverage-url]: https://app.codacy.com/gh/tstyche/tstyche/coverage/dashboard
102
102
  [starter-badge]: https://developer.stackblitz.com/img/open_in_stackblitz.svg
103
- [starter-url]: https://stackblitz.com/fork/github/tstyche/tstyche-starter?file=README.md&title=TSTyche%20Starter%20Project&view=editor
103
+ [starter-url]: https://tstyche.org/new
package/dist/tstyche.js CHANGED
@@ -4587,9 +4587,6 @@ function getTargetSymbol(symbol, compiler) {
4587
4587
  function isCheckFlagSet(symbol, flag, compiler) {
4588
4588
  return !!(symbol.flags & compiler.SymbolFlags.Transient && symbol.links.checkFlags & flag);
4589
4589
  }
4590
- function isSymbolFromDefaultLibrary(symbol, program) {
4591
- return !!symbol.declarations?.every((declaration) => program.isSourceFileDefaultLibrary(declaration.getSourceFile()));
4592
- }
4593
4590
 
4594
4591
  function getParameterFactsFromTuple(type, position, compiler) {
4595
4592
  return {
@@ -4677,13 +4674,11 @@ class SeenService {
4677
4674
  class Structure {
4678
4675
  #compiler;
4679
4676
  #compilerOptions;
4680
- #program;
4681
4677
  #seen = new SeenService();
4682
4678
  #typeChecker;
4683
4679
  constructor(compiler, program) {
4684
4680
  this.#compiler = compiler;
4685
4681
  this.#compilerOptions = program.getCompilerOptions();
4686
- this.#program = program;
4687
4682
  this.#typeChecker = program.getTypeChecker();
4688
4683
  }
4689
4684
  #compareMaybeNullish(a, b) {
@@ -4791,9 +4786,8 @@ class Structure {
4791
4786
  }
4792
4787
  compareObjects(a, b) {
4793
4788
  if (a.objectFlags & b.objectFlags & this.#compiler.ObjectFlags.Reference) {
4794
- const isSame = this.compareTypeReferences(a, b);
4795
- if (isSame != null) {
4796
- return isSame;
4789
+ if (!((a.objectFlags | b.objectFlags) & this.#compiler.ObjectFlags.ClassOrInterface)) {
4790
+ return this.compareTypeReferences(a, b);
4797
4791
  }
4798
4792
  }
4799
4793
  return this.compareStructuredTypes(a, b);
@@ -4805,21 +4799,20 @@ class Structure {
4805
4799
  }
4806
4800
  return false;
4807
4801
  }
4808
- if ((a.objectFlags | b.objectFlags) & this.#compiler.ObjectFlags.Class) {
4802
+ if (!this.compare(a.target, b.target)) {
4809
4803
  return this.compareStructuredTypes(a, b);
4810
4804
  }
4811
- if (a.symbol !== b.symbol) {
4812
- if (isSymbolFromDefaultLibrary(a.symbol, this.#program) || isSymbolFromDefaultLibrary(b.symbol, this.#program)) {
4813
- return false;
4814
- }
4815
- return;
4816
- }
4817
4805
  const aTypeArguments = this.#typeChecker.getTypeArguments(a);
4818
4806
  const bTypeArguments = this.#typeChecker.getTypeArguments(b);
4819
4807
  if (aTypeArguments.length !== bTypeArguments.length) {
4820
4808
  return false;
4821
4809
  }
4822
- return aTypeArguments.every((type, i) => this.compare(type, bTypeArguments[i]));
4810
+ for (let i = 0; i < aTypeArguments.length; i++) {
4811
+ if (!this.compare(aTypeArguments[i], bTypeArguments[i])) {
4812
+ return false;
4813
+ }
4814
+ }
4815
+ return true;
4823
4816
  }
4824
4817
  compareTuples(a, b) {
4825
4818
  if (a.target.readonly !== b.target.readonly) {
@@ -5912,7 +5905,7 @@ class FileRunner {
5912
5905
  class Runner {
5913
5906
  #eventEmitter = new EventEmitter();
5914
5907
  #resolvedConfig;
5915
- static version = "6.0.0";
5908
+ static version = "6.0.1";
5916
5909
  constructor(resolvedConfig) {
5917
5910
  this.#resolvedConfig = resolvedConfig;
5918
5911
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tstyche",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Everything You Need for Type Testing.",
5
5
  "keywords": [
6
6
  "typescript",