eslint-plugin-obsidian 2.7.0 → 2.9.0

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.
Files changed (113) hide show
  1. package/dist/dto/callExpression.d.ts +14 -0
  2. package/dist/dto/callExpression.d.ts.map +1 -0
  3. package/dist/dto/callExpression.js +32 -0
  4. package/dist/dto/callExpression.js.map +1 -0
  5. package/dist/dto/class.js +2 -2
  6. package/dist/dto/class.js.map +1 -1
  7. package/dist/dto/componentProps.d.ts +8 -0
  8. package/dist/dto/componentProps.d.ts.map +1 -0
  9. package/dist/dto/componentProps.js +30 -0
  10. package/dist/dto/componentProps.js.map +1 -0
  11. package/dist/dto/context.d.ts +1 -1
  12. package/dist/dto/context.d.ts.map +1 -1
  13. package/dist/dto/decorator.js +2 -2
  14. package/dist/dto/decorator.js.map +1 -1
  15. package/dist/dto/file.d.ts +3 -1
  16. package/dist/dto/file.d.ts.map +1 -1
  17. package/dist/dto/file.js +14 -6
  18. package/dist/dto/file.js.map +1 -1
  19. package/dist/dto/functionalComponent.d.ts +8 -0
  20. package/dist/dto/functionalComponent.d.ts.map +1 -0
  21. package/dist/dto/functionalComponent.js +14 -0
  22. package/dist/dto/functionalComponent.js.map +1 -0
  23. package/dist/dto/generics.d.ts +9 -0
  24. package/dist/dto/generics.d.ts.map +1 -0
  25. package/dist/dto/generics.js +24 -0
  26. package/dist/dto/generics.js.map +1 -0
  27. package/dist/dto/identifier.d.ts +7 -0
  28. package/dist/dto/identifier.d.ts.map +1 -0
  29. package/dist/dto/identifier.js +13 -0
  30. package/dist/dto/identifier.js.map +1 -0
  31. package/dist/dto/types/missingType.d.ts +9 -0
  32. package/dist/dto/types/missingType.d.ts.map +1 -0
  33. package/dist/dto/types/missingType.js +22 -0
  34. package/dist/dto/types/missingType.js.map +1 -0
  35. package/dist/dto/types/singleType.d.ts +12 -0
  36. package/dist/dto/types/singleType.d.ts.map +1 -0
  37. package/dist/dto/types/singleType.js +29 -0
  38. package/dist/dto/types/singleType.js.map +1 -0
  39. package/dist/dto/types/type.d.ts +8 -0
  40. package/dist/dto/types/type.d.ts.map +1 -0
  41. package/dist/dto/types/type.js +3 -0
  42. package/dist/dto/types/type.js.map +1 -0
  43. package/dist/dto/types/typeIntersection.d.ts +13 -0
  44. package/dist/dto/types/typeIntersection.d.ts.map +1 -0
  45. package/dist/dto/types/typeIntersection.js +36 -0
  46. package/dist/dto/types/typeIntersection.js.map +1 -0
  47. package/dist/dto/types/typeLiteral.d.ts +11 -0
  48. package/dist/dto/types/typeLiteral.d.ts.map +1 -0
  49. package/dist/dto/types/typeLiteral.js +29 -0
  50. package/dist/dto/types/typeLiteral.js.map +1 -0
  51. package/dist/dto/types/typeReference.d.ts +12 -0
  52. package/dist/dto/types/typeReference.d.ts.map +1 -0
  53. package/dist/dto/types/typeReference.js +27 -0
  54. package/dist/dto/types/typeReference.js.map +1 -0
  55. package/dist/dto/variable.d.ts +9 -0
  56. package/dist/dto/variable.d.ts.map +1 -0
  57. package/dist/dto/variable.js +25 -0
  58. package/dist/dto/variable.js.map +1 -0
  59. package/dist/index.js +2 -0
  60. package/dist/index.js.map +1 -1
  61. package/dist/rules/stronglyTypedInjectComponent/createRule.d.ts +8 -0
  62. package/dist/rules/stronglyTypedInjectComponent/createRule.d.ts.map +1 -0
  63. package/dist/rules/stronglyTypedInjectComponent/createRule.js +17 -0
  64. package/dist/rules/stronglyTypedInjectComponent/createRule.js.map +1 -0
  65. package/dist/rules/stronglyTypedInjectComponent/index.d.ts +8 -0
  66. package/dist/rules/stronglyTypedInjectComponent/index.d.ts.map +1 -0
  67. package/dist/rules/stronglyTypedInjectComponent/index.js +43 -0
  68. package/dist/rules/stronglyTypedInjectComponent/index.js.map +1 -0
  69. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.d.ts +11 -0
  70. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.d.ts.map +1 -0
  71. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.js +26 -0
  72. package/dist/rules/stronglyTypedInjectComponent/injectComponentHandler.js.map +1 -0
  73. package/dist/rules/stronglyTypedInjectComponent/result/errorReporter.d.ts +9 -0
  74. package/dist/rules/stronglyTypedInjectComponent/result/errorReporter.d.ts.map +1 -0
  75. package/dist/rules/stronglyTypedInjectComponent/result/errorReporter.js +17 -0
  76. package/dist/rules/stronglyTypedInjectComponent/result/errorReporter.js.map +1 -0
  77. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.d.ts +9 -0
  78. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.d.ts.map +1 -0
  79. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.js +14 -0
  80. package/dist/rules/stronglyTypedInjectComponent/result/missingTypeError.js.map +1 -0
  81. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.d.ts +9 -0
  82. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.d.ts.map +1 -0
  83. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.js +15 -0
  84. package/dist/rules/stronglyTypedInjectComponent/result/redundantTypeError.js.map +1 -0
  85. package/dist/rules/stronglyTypedInjectComponent/result/result.d.ts +5 -0
  86. package/dist/rules/stronglyTypedInjectComponent/result/result.d.ts.map +1 -0
  87. package/dist/rules/stronglyTypedInjectComponent/result/result.js +3 -0
  88. package/dist/rules/stronglyTypedInjectComponent/result/result.js.map +1 -0
  89. package/dist/rules/stronglyTypedInjectComponent/result/success.d.ts +6 -0
  90. package/dist/rules/stronglyTypedInjectComponent/result/success.d.ts.map +1 -0
  91. package/dist/rules/stronglyTypedInjectComponent/result/success.js +13 -0
  92. package/dist/rules/stronglyTypedInjectComponent/result/success.js.map +1 -0
  93. package/dist/rules/stronglyTypedInjectComponent/typeValidator.d.ts +16 -0
  94. package/dist/rules/stronglyTypedInjectComponent/typeValidator.d.ts.map +1 -0
  95. package/dist/rules/stronglyTypedInjectComponent/typeValidator.js +57 -0
  96. package/dist/rules/stronglyTypedInjectComponent/typeValidator.js.map +1 -0
  97. package/dist/rules/unresolvedProviderDependencies/subgraphResolver.js +3 -3
  98. package/dist/rules/unresolvedProviderDependencies/subgraphResolver.js.map +1 -1
  99. package/dist/utils/array.d.ts +3 -0
  100. package/dist/utils/array.d.ts.map +1 -0
  101. package/dist/utils/array.js +12 -0
  102. package/dist/utils/array.js.map +1 -0
  103. package/dist/{ast/utils.d.ts → utils/ast.d.ts} +7 -2
  104. package/dist/utils/ast.d.ts.map +1 -0
  105. package/dist/{ast/utils.js → utils/ast.js} +27 -13
  106. package/dist/utils/ast.js.map +1 -0
  107. package/dist/utils/regex.d.ts +2 -0
  108. package/dist/utils/regex.d.ts.map +1 -0
  109. package/dist/utils/regex.js +10 -0
  110. package/dist/utils/regex.js.map +1 -0
  111. package/package.json +2 -1
  112. package/dist/ast/utils.d.ts.map +0 -1
  113. package/dist/ast/utils.js.map +0 -1
@@ -0,0 +1,14 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import { Identifier } from './identifier';
3
+ import { Generics } from './generics';
4
+ export declare class CallExpression {
5
+ readonly node: TSESTree.CallExpression;
6
+ constructor(node: TSESTree.CallExpression);
7
+ isExpression(name: string): boolean;
8
+ get name(): string;
9
+ get parent(): TSESTree.Node;
10
+ get arguments(): Identifier[];
11
+ get generics(): Generics | undefined;
12
+ private get callee();
13
+ }
14
+ //# sourceMappingURL=callExpression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callExpression.d.ts","sourceRoot":"","sources":["../../src/dto/callExpression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAa,cAAc;IACb,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc;gBAA7B,IAAI,EAAE,QAAQ,CAAC,cAAc;IAE3C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1C,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,MAAM,IAAI,QAAQ,CAAC,IAAI,CAE1B;IAED,IAAI,SAAS,IAAI,UAAU,EAAE,CAE5B;IAED,IAAI,QAAQ,yBAIX;IAED,OAAO,KAAK,MAAM,GAEjB;CACF"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CallExpression = void 0;
4
+ const identifier_1 = require("./identifier");
5
+ const generics_1 = require("./generics");
6
+ class CallExpression {
7
+ constructor(node) {
8
+ this.node = node;
9
+ }
10
+ isExpression(name) {
11
+ return this.name === name;
12
+ }
13
+ get name() {
14
+ return this.callee.name;
15
+ }
16
+ get parent() {
17
+ return this.node.parent;
18
+ }
19
+ get arguments() {
20
+ return this.node.arguments.map((arg) => new identifier_1.Identifier(arg));
21
+ }
22
+ get generics() {
23
+ return this.node.typeArguments ?
24
+ new generics_1.Generics(this.node.typeArguments) :
25
+ this.node.typeParameters && new generics_1.Generics(this.node.typeParameters);
26
+ }
27
+ get callee() {
28
+ return this.node.callee;
29
+ }
30
+ }
31
+ exports.CallExpression = CallExpression;
32
+ //# sourceMappingURL=callExpression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callExpression.js","sourceRoot":"","sources":["../../src/dto/callExpression.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,yCAAsC;AAEtC,MAAa,cAAc;IACzB,YAAqB,IAA6B;QAA7B,SAAI,GAAJ,IAAI,CAAyB;IAAI,CAAC;IAEhD,YAAY,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAO,CAAC;IAC3B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,uBAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC9B,IAAI,mBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,IAAI,CAAC,cAAc,IAAI,IAAI,mBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACvE,CAAC;IAED,IAAY,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAA6B,CAAC;IACjD,CAAC;CACF;AA5BD,wCA4BC"}
package/dist/dto/class.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Clazz = void 0;
4
4
  const decorator_1 = require("./decorator");
5
5
  const assertions_1 = require("../utils/assertions");
6
- const utils_1 = require("../ast/utils");
6
+ const ast_1 = require("../utils/ast");
7
7
  const method_1 = require("./method");
8
8
  class Clazz {
9
9
  constructor(node) {
@@ -26,7 +26,7 @@ class Clazz {
26
26
  }
27
27
  getDecoratedMethods(decoratorName) {
28
28
  return this.body
29
- .filter(utils_1.isMethodDefinition)
29
+ .filter(ast_1.isMethodDefinition)
30
30
  .map((node) => new method_1.Method(node))
31
31
  .filter((method) => method.isDecoratedWith(decoratorName));
32
32
  }
@@ -1 +1 @@
1
- {"version":3,"file":"class.js","sourceRoot":"","sources":["../../src/dto/class.ts"],"names":[],"mappings":";;;AACA,2CAAwC;AACxC,oDAAoD;AACpD,wCAAkD;AAClD,qCAAkC;AAElC,MAAa,KAAK;IAChB,YAAmB,IAA+B;QAA/B,SAAI,GAAJ,IAAI,CAA2B;QAChD,IAAA,0BAAa,EAAC,IAAI,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/D,OAAO,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;QACpD,CAAC,CAAC,CAAC;QACH,IAAA,0BAAa,EAAC,SAAS,EAAE,aAAa,IAAI,uBAAuB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAY,IAAI;;QACd,OAAO,MAAA,IAAI,CAAC,IAAI,CAAC,EAAE,0CAAE,IAAI,CAAC;IAC5B,CAAC;CACF;AAvCD,sBAuCC"}
@@ -0,0 +1,8 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import type { Type } from './types/type';
3
+ export declare class ComponentProps {
4
+ private props;
5
+ constructor(props: TSESTree.Parameter);
6
+ get type(): Type;
7
+ }
8
+ //# sourceMappingURL=componentProps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentProps.d.ts","sourceRoot":"","sources":["../../src/dto/componentProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAUzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,qBAAa,cAAc;IAEb,OAAO,CAAC,KAAK;gBADb,KAAK,EAAE,QAAQ,CAAC,SAAS;IAGrC,IAAI,IAAI,IAAI,IAAI,CAQf;CACF"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComponentProps = void 0;
4
+ const ast_1 = require("../utils/ast");
5
+ const singleType_1 = require("./types/singleType");
6
+ const typeIntersection_1 = require("./types/typeIntersection");
7
+ const missingType_1 = require("./types/missingType");
8
+ const typeReference_1 = require("./types/typeReference");
9
+ class ComponentProps {
10
+ constructor(props) {
11
+ this.props = props;
12
+ }
13
+ get type() {
14
+ var _a, _b, _c;
15
+ const typeAnnotation = (_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.typeAnnotation) === null || _b === void 0 ? void 0 : _b.typeAnnotation;
16
+ if (!typeAnnotation)
17
+ return new missingType_1.MissingType();
18
+ if ((0, ast_1.isTypeIntersection)(typeAnnotation))
19
+ return new typeIntersection_1.TypeIntersection(typeAnnotation);
20
+ if ((0, ast_1.isAnyType)(typeAnnotation))
21
+ return new missingType_1.MissingType();
22
+ if ((0, ast_1.isTypeReference)(typeAnnotation))
23
+ return new typeReference_1.TypeReference(typeAnnotation);
24
+ if ((0, ast_1.isTypeAnnotation)((_c = this.props) === null || _c === void 0 ? void 0 : _c.typeAnnotation))
25
+ return new singleType_1.SingleType(this.props);
26
+ return new missingType_1.MissingType();
27
+ }
28
+ }
29
+ exports.ComponentProps = ComponentProps;
30
+ //# sourceMappingURL=componentProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentProps.js","sourceRoot":"","sources":["../../src/dto/componentProps.ts"],"names":[],"mappings":";;;AACA,sCAKsB;AACtB,mDAAgD;AAChD,+DAA4D;AAC5D,qDAAkD;AAElD,yDAAsD;AAEtD,MAAa,cAAc;IAEzB,YAAoB,KAA0B;QAA1B,UAAK,GAAL,KAAK,CAAqB;IAAI,CAAC;IAEnD,IAAI,IAAI;;QACN,MAAM,cAAc,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,0CAAE,cAAc,CAAC;QAClE,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,yBAAW,EAAE,CAAC;QAC9C,IAAI,IAAA,wBAAkB,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,mCAAgB,CAAC,cAAc,CAAC,CAAC;QACpF,IAAI,IAAA,eAAS,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,yBAAW,EAAE,CAAC;QACxD,IAAI,IAAA,qBAAe,EAAC,cAAc,CAAC;YAAE,OAAO,IAAI,6BAAa,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,IAAA,sBAAgB,EAAC,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,CAAC;YAAE,OAAO,IAAI,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpF,OAAO,IAAI,yBAAW,EAAE,CAAC;IAC3B,CAAC;CACF;AAbD,wCAaC"}
@@ -1,6 +1,6 @@
1
1
  import type { TSESTree } from '@typescript-eslint/types';
2
2
  import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
3
- export declare class Context<MessageId extends string = any, Options extends any[] = any> {
3
+ export declare class Context<MessageId extends string = any, Options extends readonly unknown[] = any> {
4
4
  private context;
5
5
  constructor(context: RuleContext<MessageId, Options>);
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/dto/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,qBAAa,OAAO,CAAC,SAAS,SAAS,MAAM,GAAG,GAAG,EAAE,OAAO,SAAS,GAAG,EAAE,GAAG,GAAG;IAClE,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5D;;OAEG;IACH,IAAW,eAAe,WAEzB;IAEM,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG;CAGxE"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/dto/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,qBAAa,OAAO,CAAC,SAAS,SAAS,MAAM,GAAG,GAAG,EAAE,OAAO,SAAS,SAAS,OAAO,EAAE,GAAG,GAAG;IAC/E,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5D;;OAEG;IACH,IAAW,eAAe,WAEzB;IAEM,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG;CAGxE"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Decorator = void 0;
4
- const utils_1 = require("../ast/utils");
4
+ const ast_1 = require("../utils/ast");
5
5
  const property_1 = require("./property");
6
6
  class Decorator {
7
7
  constructor(node) {
@@ -11,7 +11,7 @@ class Decorator {
11
11
  return this.node.expression;
12
12
  }
13
13
  getProperty(name) {
14
- const property = (0, utils_1.getDecoratorProperty)(this.node, name);
14
+ const property = (0, ast_1.getDecoratorProperty)(this.node, name);
15
15
  return property && new property_1.Property(property);
16
16
  }
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../src/dto/decorator.ts"],"names":[],"mappings":";;;AACA,wCAAoD;AACpD,yCAAsC;AAMtC,MAAa,SAAS;IACpB,YAAoB,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IAEhD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,UAA4B,CAAC;IAChD,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,MAAM,QAAQ,GAAG,IAAA,4BAAoB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvD,OAAO,QAAQ,IAAI,IAAI,mBAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAXD,8BAWC"}
1
+ {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../src/dto/decorator.ts"],"names":[],"mappings":";;;AACA,sCAAoD;AACpD,yCAAsC;AAMtC,MAAa,SAAS;IACpB,YAAoB,IAAwB;QAAxB,SAAI,GAAJ,IAAI,CAAoB;IAAG,CAAC;IAEhD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,UAA4B,CAAC;IAChD,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,MAAM,QAAQ,GAAG,IAAA,0BAAoB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvD,OAAO,QAAQ,IAAI,IAAI,mBAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAXD,8BAWC"}
@@ -2,15 +2,17 @@ import type { TSESTree } from '@typescript-eslint/types';
2
2
  import { Clazz } from './class';
3
3
  import { Import } from './import';
4
4
  import { ClassFile } from './classFile';
5
+ import { Variable } from './variable';
5
6
  export declare class File {
6
7
  private program;
7
8
  private path;
8
- constructor(program: TSESTree.Program, path: string);
9
+ constructor(program: TSESTree.Program, path?: string);
9
10
  requireGraph(name: string): Clazz;
10
11
  private get classNodes();
11
12
  private get body();
12
13
  toClassWithImports(): ClassFile[];
13
14
  get imports(): Import[];
14
15
  get graphs(): Clazz[];
16
+ get variables(): Variable[];
15
17
  }
16
18
  //# sourceMappingURL=file.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/dto/file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,qBAAa,IAAI;IAEb,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;gBADJ,OAAO,EAAE,QAAQ,CAAC,OAAO,EACzB,IAAI,EAAE,MAAM;IAGf,YAAY,CAAC,IAAI,EAAE,MAAM;IAQhC,OAAO,KAAK,UAAU,GAIrB;IAED,OAAO,KAAK,IAAI,GAEf;IAEM,kBAAkB;IAMzB,IAAI,OAAO,aAIV;IAED,IAAI,MAAM,YAUT;CACF"}
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/dto/file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAOhC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,qBAAa,IAAI;IAEH,OAAO,CAAC,OAAO;IAAmB,OAAO,CAAC,IAAI;gBAD9C,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM;IAG7C,YAAY,CAAC,IAAI,EAAE,MAAM;IAQhC,OAAO,KAAK,UAAU,GAIrB;IAED,OAAO,KAAK,IAAI,GAEf;IAEM,kBAAkB;IAMzB,IAAI,OAAO,aAIV;IAED,IAAI,MAAM,YAUT;IAED,IAAI,SAAS,eAMZ;CACF"}
package/dist/dto/file.js CHANGED
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.File = void 0;
4
4
  const class_1 = require("./class");
5
- const utils_1 = require("../ast/utils");
5
+ const ast_1 = require("../utils/ast");
6
6
  const import_1 = require("./import");
7
7
  const classFile_1 = require("./classFile");
8
8
  const assertions_1 = require("../utils/assertions");
9
+ const variable_1 = require("./variable");
9
10
  class File {
10
11
  constructor(program, path) {
11
12
  this.program = program;
@@ -21,8 +22,8 @@ class File {
21
22
  }
22
23
  get classNodes() {
23
24
  return this.body
24
- .filter(utils_1.isClassLike)
25
- .map(utils_1.getClassDeclaration);
25
+ .filter(ast_1.isClassLike)
26
+ .map(ast_1.getClassDeclaration);
26
27
  }
27
28
  get body() {
28
29
  return this.program.body;
@@ -34,20 +35,27 @@ class File {
34
35
  }
35
36
  get imports() {
36
37
  return this.body
37
- .filter(utils_1.isImportDeclaration)
38
+ .filter(ast_1.isImportDeclaration)
38
39
  .map((node) => new import_1.Import(node));
39
40
  }
40
41
  get graphs() {
41
42
  return this.body
42
- .filter(utils_1.isClassLike)
43
+ .filter(ast_1.isClassLike)
43
44
  .map((node) => {
44
- const clazz = (0, utils_1.getClassDeclaration)(node);
45
+ const clazz = (0, ast_1.getClassDeclaration)(node);
45
46
  return clazz && new class_1.Clazz(clazz);
46
47
  })
47
48
  .filter((clazz) => {
48
49
  return clazz ? clazz.decoratorNames.includes('Graph') : false;
49
50
  });
50
51
  }
52
+ get variables() {
53
+ return this.body
54
+ .filter(ast_1.isVariableDeclaration)
55
+ .map((node) => node.declarations)
56
+ .flat()
57
+ .map((node) => new variable_1.Variable(node));
58
+ }
51
59
  }
52
60
  exports.File = File;
53
61
  //# sourceMappingURL=file.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file.js","sourceRoot":"","sources":["../../src/dto/file.ts"],"names":[],"mappings":";;;AACA,mCAAgC;AAChC,wCAAqF;AACrF,qCAAkC;AAClC,2CAAwC;AACxC,oDAAoD;AAEpD,MAAa,IAAI;IACf,YACU,OAAyB,EACzB,IAAY;QADZ,YAAO,GAAP,OAAO,CAAkB;QACzB,SAAI,GAAJ,IAAI,CAAQ;IAClB,CAAC;IAEE,YAAY,CAAC,IAAY;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;;YAC1C,OAAO,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,0CAAE,IAAI,MAAK,IAAI,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,IAAA,0BAAa,EAAC,KAAK,EAAE,SAAS,IAAI,oBAAoB,CAAC,CAAC;QACxD,OAAO,IAAI,aAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED,IAAY,UAAU;QACpB,OAAO,IAAI,CAAC,IAAI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AC,CAAC;YACxC,OAAO,KAAK,IAAI,IAAI,aAAK,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,KAAwB,EAAE,EAAE;YACnC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAChE,CAAC,CAAY,CAAC;IAClB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,IAAI;aACb,MAAM,CAAC,2BAAqB,CAAC;aAC7B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC;aAChC,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,mBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACvC,CAAC;CACF;AArDD,oBAqDC"}
@@ -0,0 +1,8 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import { ComponentProps } from './componentProps';
3
+ export declare class FunctionalComponent {
4
+ private node;
5
+ constructor(node: TSESTree.ArrowFunctionExpression);
6
+ get props(): ComponentProps;
7
+ }
8
+ //# sourceMappingURL=functionalComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functionalComponent.d.ts","sourceRoot":"","sources":["../../src/dto/functionalComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAAa,mBAAmB;IAClB,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,QAAQ,CAAC,uBAAuB;IAE1D,IAAI,KAAK,IAAI,cAAc,CAE1B;CACF"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FunctionalComponent = void 0;
4
+ const componentProps_1 = require("./componentProps");
5
+ class FunctionalComponent {
6
+ constructor(node) {
7
+ this.node = node;
8
+ }
9
+ get props() {
10
+ return new componentProps_1.ComponentProps(this.node.params[0]);
11
+ }
12
+ }
13
+ exports.FunctionalComponent = FunctionalComponent;
14
+ //# sourceMappingURL=functionalComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functionalComponent.js","sourceRoot":"","sources":["../../src/dto/functionalComponent.ts"],"names":[],"mappings":";;;AACA,qDAAkD;AAElD,MAAa,mBAAmB;IAC9B,YAAoB,IAAsC;QAAtC,SAAI,GAAJ,IAAI,CAAkC;IAAG,CAAC;IAE9D,IAAI,KAAK;QACP,OAAO,IAAI,+BAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;CACF;AAND,kDAMC"}
@@ -0,0 +1,9 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import type { Type } from './types/type';
3
+ export declare class Generics {
4
+ readonly node: TSESTree.TSTypeParameterInstantiation;
5
+ constructor(node: TSESTree.TSTypeParameterInstantiation | undefined);
6
+ get types(): Type[];
7
+ private get params();
8
+ }
9
+ //# sourceMappingURL=generics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../src/dto/generics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,qBAAa,QAAQ;IAEP,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,4BAA4B;gBADpD,IAAI,EAAE,QAAQ,CAAC,4BAA4B,GAAG,SAAS;IAKnE,IAAI,KAAK,IAAI,IAAI,EAAE,CAKlB;IAED,OAAO,KAAK,MAAM,GAEjB;CACF"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Generics = void 0;
4
+ const assertions_1 = require("../utils/assertions");
5
+ const ast_1 = require("../utils/ast");
6
+ const typeLiteral_1 = require("./types/typeLiteral");
7
+ const typeReference_1 = require("./types/typeReference");
8
+ class Generics {
9
+ constructor(node) {
10
+ this.node = node;
11
+ (0, assertions_1.assertDefined)(node);
12
+ }
13
+ get types() {
14
+ return this.params
15
+ .map((param) => {
16
+ return (0, ast_1.isTypeLiteral)(param) ? new typeLiteral_1.TypeLiteral() : new typeReference_1.TypeReference(param);
17
+ });
18
+ }
19
+ get params() {
20
+ return this.node.params;
21
+ }
22
+ }
23
+ exports.Generics = Generics;
24
+ //# sourceMappingURL=generics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generics.js","sourceRoot":"","sources":["../../src/dto/generics.ts"],"names":[],"mappings":";;;AACA,oDAAoD;AACpD,sCAA6C;AAC7C,qDAAkD;AAElD,yDAAsD;AAEtD,MAAa,QAAQ;IAEnB,YAAqB,IAA2C;QAA3C,SAAI,GAAJ,IAAI,CAAuC;QAC9D,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM;aACf,GAAG,CAAC,CAAC,KAA+B,EAAE,EAAE;YACvC,OAAO,IAAA,mBAAa,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,yBAAW,EAAE,CAAC,CAAC,CAAC,IAAI,6BAAa,CAAC,KAAK,CAAC,CAAC;QAC7E,CAAC,CAAC,CAAC;IACP,CAAC;IAED,IAAY,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAoC,CAAC;IACxD,CAAC;CACF;AAhBD,4BAgBC"}
@@ -0,0 +1,7 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ export declare class Identifier {
3
+ private node;
4
+ constructor(node: TSESTree.Node);
5
+ get name(): string;
6
+ }
7
+ //# sourceMappingURL=identifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifier.d.ts","sourceRoot":"","sources":["../../src/dto/identifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,qBAAa,UAAU;IAET,OAAO,CAAC,IAAI;gBADZ,IAAI,EAAE,QAAQ,CAAC,IAAI;IAG/B,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Identifier = void 0;
4
+ class Identifier {
5
+ constructor(node) {
6
+ this.node = node;
7
+ }
8
+ get name() {
9
+ return this.node.name;
10
+ }
11
+ }
12
+ exports.Identifier = Identifier;
13
+ //# sourceMappingURL=identifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identifier.js","sourceRoot":"","sources":["../../src/dto/identifier.ts"],"names":[],"mappings":";;;AAEA,MAAa,UAAU;IAErB,YAAoB,IAAyB;QAAzB,SAAI,GAAJ,IAAI,CAAqB;IAAG,CAAC;IAEjD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;CACF;AAPD,gCAOC"}
@@ -0,0 +1,9 @@
1
+ import type { Type } from './type';
2
+ export declare class MissingType implements Type {
3
+ toString(): string[];
4
+ isEmpty(): boolean;
5
+ equals(types: Type[]): boolean;
6
+ includes(): boolean;
7
+ size(): number;
8
+ }
9
+ //# sourceMappingURL=missingType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missingType.d.ts","sourceRoot":"","sources":["../../../src/dto/types/missingType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,qBAAa,WAAY,YAAW,IAAI;IACtC,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,IAAI,OAAO;IAInB,IAAI,IAAI,MAAM;CAGf"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MissingType = void 0;
4
+ class MissingType {
5
+ toString() {
6
+ return [];
7
+ }
8
+ isEmpty() {
9
+ return true;
10
+ }
11
+ equals(types) {
12
+ return types.length === 0 || types.length === 1 && types[0].isEmpty();
13
+ }
14
+ includes() {
15
+ return false;
16
+ }
17
+ size() {
18
+ return 0;
19
+ }
20
+ }
21
+ exports.MissingType = MissingType;
22
+ //# sourceMappingURL=missingType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missingType.js","sourceRoot":"","sources":["../../../src/dto/types/missingType.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IACtB,QAAQ;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACxE,CAAC;IAED,QAAQ;QACJ,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI;QACF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AApBD,kCAoBC"}
@@ -0,0 +1,12 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import type { Type } from './type';
3
+ export declare class SingleType implements Type {
4
+ private props;
5
+ constructor(props: TSESTree.Identifier);
6
+ toString(): string[];
7
+ isEmpty(): boolean;
8
+ equals(types: Type[]): boolean;
9
+ includes(type: Type[]): boolean;
10
+ size(): number;
11
+ }
12
+ //# sourceMappingURL=singleType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleType.d.ts","sourceRoot":"","sources":["../../../src/dto/types/singleType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,UAAW,YAAW,IAAI;IACzB,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ,CAAC,UAAU;IAE9C,QAAQ,IAAI,MAAM,EAAE;IAKpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,IAAI,IAAI,MAAM;CAGf"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SingleType = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const identifier_1 = require("../identifier");
6
+ class SingleType {
7
+ constructor(props) {
8
+ this.props = props;
9
+ }
10
+ toString() {
11
+ var _a, _b;
12
+ const typeRef = (_b = (_a = this.props) === null || _a === void 0 ? void 0 : _a.typeAnnotation) === null || _b === void 0 ? void 0 : _b.typeAnnotation;
13
+ return [new identifier_1.Identifier(typeRef.typeName).name];
14
+ }
15
+ isEmpty() {
16
+ return false;
17
+ }
18
+ equals(types) {
19
+ return types.length === 1 && types[0].toString() === this.toString();
20
+ }
21
+ includes(type) {
22
+ return type.some((t) => (0, lodash_1.isEqual)(t.toString(), this.toString()));
23
+ }
24
+ size() {
25
+ return 1;
26
+ }
27
+ }
28
+ exports.SingleType = SingleType;
29
+ //# sourceMappingURL=singleType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"singleType.js","sourceRoot":"","sources":["../../../src/dto/types/singleType.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AAEjC,8CAA2C;AAE3C,MAAa,UAAU;IACrB,YAAoB,KAA0B;QAA1B,UAAK,GAAL,KAAK,CAAqB;IAAG,CAAC;IAElD,QAAQ;;QACN,MAAM,OAAO,GAAG,MAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,cAAc,0CAAE,cAA0C,CAAC;QACvF,OAAO,CAAC,IAAI,uBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,IAAI;QACF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AAvBD,gCAuBC"}
@@ -0,0 +1,8 @@
1
+ export interface Type {
2
+ toString(): string[];
3
+ isEmpty(): boolean;
4
+ equals(types: Type[]): boolean;
5
+ includes(type: Type[]): boolean;
6
+ size(): number;
7
+ }
8
+ //# sourceMappingURL=type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/dto/types/type.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,QAAQ,IAAI,MAAM,EAAE,CAAC;IACrB,OAAO,IAAI,OAAO,CAAC;IACnB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAChC,IAAI,IAAI,MAAM,CAAC;CAChB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/dto/types/type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import { Type } from './type';
3
+ export declare class TypeIntersection implements Type {
4
+ private typeAnnotation;
5
+ constructor(typeAnnotation: TSESTree.TSIntersectionType);
6
+ toString(): string[];
7
+ isEmpty(): boolean;
8
+ equals(types: Type[]): boolean;
9
+ includes(type: Type[]): boolean;
10
+ private get types();
11
+ size(): number;
12
+ }
13
+ //# sourceMappingURL=typeIntersection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeIntersection.d.ts","sourceRoot":"","sources":["../../../src/dto/types/typeIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,qBAAa,gBAAiB,YAAW,IAAI;IAC/B,OAAO,CAAC,cAAc;gBAAd,cAAc,EAAE,QAAQ,CAAC,kBAAkB;IAE/D,QAAQ,IAAI,MAAM,EAAE;IAOpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,OAAO,KAAK,KAAK,GAIhB;IAED,IAAI,IAAI,MAAM;CAGf"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeIntersection = void 0;
4
+ const lodash_1 = require("lodash");
5
+ const identifier_1 = require("../identifier");
6
+ const typeReference_1 = require("./typeReference");
7
+ class TypeIntersection {
8
+ constructor(typeAnnotation) {
9
+ this.typeAnnotation = typeAnnotation;
10
+ }
11
+ toString() {
12
+ return this.typeAnnotation.types.map((type) => {
13
+ const typeRef = type;
14
+ return new identifier_1.Identifier(typeRef.typeName).name;
15
+ });
16
+ }
17
+ isEmpty() {
18
+ return this.typeAnnotation.types.length === 0;
19
+ }
20
+ equals(types) {
21
+ return (0, lodash_1.isEqual)(this.toString(), types.map((type) => type.toString()).flat());
22
+ }
23
+ includes(type) {
24
+ return this.types.every((t) => t.includes(type));
25
+ }
26
+ get types() {
27
+ return this.typeAnnotation.types.map((type) => {
28
+ return new typeReference_1.TypeReference(type);
29
+ });
30
+ }
31
+ size() {
32
+ return this.typeAnnotation.types.length;
33
+ }
34
+ }
35
+ exports.TypeIntersection = TypeIntersection;
36
+ //# sourceMappingURL=typeIntersection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeIntersection.js","sourceRoot":"","sources":["../../../src/dto/types/typeIntersection.ts"],"names":[],"mappings":";;;AACA,mCAAiC;AAEjC,8CAA2C;AAC3C,mDAAgD;AAEhD,MAAa,gBAAgB;IAC3B,YAAoB,cAA2C;QAA3C,mBAAc,GAAd,cAAc,CAA6B;IAAI,CAAC;IAEpE,QAAQ;QACN,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5C,MAAM,OAAO,GAAG,IAAgC,CAAC;YACjD,OAAO,IAAI,uBAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,IAAA,gBAAO,EAAC,IAAI,CAAC,QAAQ,EAAE,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,IAAY,KAAK;QACf,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAC5C,OAAO,IAAI,6BAAa,CAAC,IAAgC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1C,CAAC;CACF;AA/BD,4CA+BC"}
@@ -0,0 +1,11 @@
1
+ import type { Type } from './type';
2
+ export declare class TypeLiteral implements Type {
3
+ private readonly name;
4
+ static isTypeLiteral(type: Type): type is TypeLiteral;
5
+ toString(): string[];
6
+ isEmpty(): boolean;
7
+ equals(types: Type[]): boolean;
8
+ includes(type: Type[]): boolean;
9
+ size(): number;
10
+ }
11
+ //# sourceMappingURL=typeLiteral.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeLiteral.d.ts","sourceRoot":"","sources":["../../../src/dto/types/typeLiteral.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,qBAAa,WAAY,YAAW,IAAI;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2B;IAEhD,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,WAAW;IAIrD,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,IAAI,IAAI,MAAM;CAGf"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeLiteral = void 0;
4
+ const lodash_1 = require("lodash");
5
+ class TypeLiteral {
6
+ constructor() {
7
+ this.name = (0, lodash_1.uniqueId)('TypeLiteral');
8
+ }
9
+ static isTypeLiteral(type) {
10
+ return type instanceof TypeLiteral;
11
+ }
12
+ toString() {
13
+ return [this.name];
14
+ }
15
+ isEmpty() {
16
+ throw new Error('Method not implemented.');
17
+ }
18
+ equals(types) {
19
+ return types.length === 1 && types[0].toString() === this.toString();
20
+ }
21
+ includes(type) {
22
+ return type.every((t) => (0, lodash_1.isEqual)(t.toString(), this.toString()));
23
+ }
24
+ size() {
25
+ return 1;
26
+ }
27
+ }
28
+ exports.TypeLiteral = TypeLiteral;
29
+ //# sourceMappingURL=typeLiteral.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeLiteral.js","sourceRoot":"","sources":["../../../src/dto/types/typeLiteral.ts"],"names":[],"mappings":";;;AAAA,mCAA2C;AAG3C,MAAa,WAAW;IAAxB;QACmB,SAAI,GAAG,IAAA,iBAAQ,EAAC,aAAa,CAAC,CAAC;IAyBlD,CAAC;IAvBC,MAAM,CAAC,aAAa,CAAC,IAAU;QAC7B,OAAO,IAAI,YAAY,WAAW,CAAC;IACrC,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,OAAO;QACL,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,KAAa;QAClB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,IAAI;QACF,OAAO,CAAC,CAAC;IACX,CAAC;CACF;AA1BD,kCA0BC"}
@@ -0,0 +1,12 @@
1
+ import type { TSESTree } from '@typescript-eslint/types';
2
+ import type { Type } from './type';
3
+ export declare class TypeReference implements Type {
4
+ private node;
5
+ constructor(node: TSESTree.TSTypeReference);
6
+ toString(): string[];
7
+ isEmpty(): boolean;
8
+ equals(types: Type[]): boolean;
9
+ includes(type: Type[]): boolean;
10
+ size(): number;
11
+ }
12
+ //# sourceMappingURL=typeReference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeReference.d.ts","sourceRoot":"","sources":["../../../src/dto/types/typeReference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC,qBAAa,aAAc,YAAW,IAAI;IAC5B,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,QAAQ,CAAC,eAAe;IAElD,QAAQ,IAAI,MAAM,EAAE;IAIpB,OAAO,IAAI,OAAO;IAIlB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO;IAI9B,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO;IAI/B,IAAI,IAAI,MAAM;CAGf"}