@lowgular/code-graph 0.0.1 → 0.1.2
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/bin/cli.js +2463 -0
- package/lib.js +2430 -0
- package/package.json +26 -7
- package/apps/code-graph/src/main.js +0 -50
- package/libs/cli/code-graph/src/index.js +0 -39
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.js +0 -72
- package/libs/cli/code-graph/src/lib/class-declarations/abstractions/service.stateful.js +0 -68
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.doc.js +0 -147
- package/libs/cli/code-graph/src/lib/class-declarations/class-declarations.graph.js +0 -55
- package/libs/cli/code-graph/src/lib/class-declarations/index.js +0 -27
- package/libs/cli/code-graph/src/lib/code.graph.factory.js +0 -63
- package/libs/cli/code-graph/src/lib/code.graph.js +0 -62
- package/libs/cli/code-graph/src/lib/core/core.js +0 -58
- package/libs/cli/code-graph/src/lib/core.js +0 -85
- package/libs/cli/code-graph/src/lib/decorators/index.js +0 -36
- package/libs/cli/code-graph/src/lib/docs/index.js +0 -21
- package/libs/cli/code-graph/src/lib/docs/specs.js +0 -36
- package/libs/cli/code-graph/src/lib/expressions/call-expressions.graph.js +0 -28
- package/libs/cli/code-graph/src/lib/fixtures/reactive-event-bus/src/app/examples.event-bus.js +0 -53
- package/libs/cli/code-graph/src/lib/method-declarations/index.js +0 -23
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.doc.js +0 -106
- package/libs/cli/code-graph/src/lib/method-declarations/method-declarations.graph.js +0 -56
- package/libs/cli/code-graph/src/lib/parameters/index.js +0 -42
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.evals.js +0 -139
- package/libs/cli/code-graph/src/lib/property-declarations/abstractions/reactive-state.js +0 -104
- package/libs/cli/code-graph/src/lib/property-declarations/index.js +0 -25
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.doc.js +0 -74
- package/libs/cli/code-graph/src/lib/property-declarations/property-declarations.graph.js +0 -43
- package/libs/cli/code-graph/src/lib/tools/index.js +0 -34
- package/libs/cli/code-graph/src/lib/tools/match-code-graph.tool.js +0 -64
- package/libs/cli/code-graph/src/lib/types/index.js +0 -99
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.doc.js +0 -345
- package/libs/cli/code-graph/src/lib/v2/extractors/extractor.js +0 -52
- package/libs/cli/code-graph/src/lib/v2/extractors/index.js +0 -23
- package/libs/cli/code-graph/src/lib/v2/graph-builder/code-graph.builder.js +0 -76
- package/libs/cli/code-graph/src/lib/v2/graph-builder/index.js +0 -21
- package/libs/cli/code-graph/src/lib/v2/graph-builder/node.processor.js +0 -48
- package/libs/cli/code-graph/src/lib/v2/graph-builder/relationship.processor.js +0 -79
- package/libs/cli/code-graph/src/lib/v2/graph-builder/type.processor.js +0 -45
- package/libs/cli/code-graph/src/lib/v2/index.js +0 -37
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.doc.js +0 -220
- package/libs/cli/code-graph/src/lib/v2/tools/build-code-graph.tool.js +0 -42
- package/libs/cli/cypher/src/index.js +0 -25
- package/libs/cli/cypher/src/lib/docs/features/advanced-optional-match.feature.js +0 -277
- package/libs/cli/cypher/src/lib/docs/features/anonymous-relationship.feature.js +0 -69
- package/libs/cli/cypher/src/lib/docs/features/anonymous-variable-length.feature.js +0 -105
- package/libs/cli/cypher/src/lib/docs/features/basic-filtering.feature.js +0 -70
- package/libs/cli/cypher/src/lib/docs/features/basic-optional-match.feature.js +0 -99
- package/libs/cli/cypher/src/lib/docs/features/basic-relationship.feature.js +0 -125
- package/libs/cli/cypher/src/lib/docs/features/index.js +0 -51
- package/libs/cli/cypher/src/lib/docs/features/limit.feature.js +0 -50
- package/libs/cli/cypher/src/lib/docs/features/match-nodes.feature.js +0 -106
- package/libs/cli/cypher/src/lib/docs/features/multiple-relationship-types.feature.js +0 -105
- package/libs/cli/cypher/src/lib/docs/features/order-by.feature.js +0 -143
- package/libs/cli/cypher/src/lib/docs/features/property-matching.feature.js +0 -152
- package/libs/cli/cypher/src/lib/docs/features/relationship-without-variable.feature.js +0 -48
- package/libs/cli/cypher/src/lib/docs/features/return-statement.feature.js +0 -65
- package/libs/cli/cypher/src/lib/docs/features/unidirected-relationship.feature.js +0 -82
- package/libs/cli/cypher/src/lib/docs/features/variable-length-path.feature.js +0 -136
- package/libs/cli/cypher/src/lib/docs/features/where-conditional.feature.js +0 -187
- package/libs/cli/cypher/src/lib/docs/features/where-operators.feature.js +0 -302
- package/libs/cli/cypher/src/lib/docs/prompts.js +0 -36
- package/libs/cli/cypher/src/lib/docs/specs.js +0 -181
- package/libs/cli/cypher/src/lib/executor/condition-evaluator.js +0 -158
- package/libs/cli/cypher/src/lib/executor/executor.js +0 -83
- package/libs/cli/cypher/src/lib/executor/graph.js +0 -15
- package/libs/cli/cypher/src/lib/executor/match-engine.js +0 -153
- package/libs/cli/cypher/src/lib/executor/pattern-matcher.js +0 -109
- package/libs/cli/cypher/src/lib/executor/relationship-navigator.js +0 -64
- package/libs/cli/cypher/src/lib/executor/result-formatter.js +0 -143
- package/libs/cli/cypher/src/lib/executor/traverse-engine.js +0 -164
- package/libs/cli/cypher/src/lib/executor/utils.js +0 -37
- package/libs/cli/cypher/src/lib/graph.stub.js +0 -63
- package/libs/cli/cypher/src/lib/index.js +0 -74
- package/libs/cli/cypher/src/lib/lexer.js +0 -398
- package/libs/cli/cypher/src/lib/parser.js +0 -602
- package/libs/cli/cypher/src/lib/validator/query-validator.js +0 -95
- package/libs/cli/cypher/src/lib/validator/supported-features.config.js +0 -111
- package/libs/cli/cypher/src/lib/validator/unsupported-features.config.js +0 -150
- package/libs/cli/shared/src/index.js +0 -53
- package/libs/cli/shared/src/lib/admin-token.js +0 -121
- package/libs/cli/shared/src/lib/config.js +0 -49
- package/libs/cli/shared/src/lib/consts.js +0 -57
- package/libs/cli/shared/src/lib/core.js +0 -46
- package/libs/cli/shared/src/lib/infrastructure/cli.js +0 -47
- package/libs/cli/shared/src/lib/infrastructure/config.js +0 -47
- package/libs/cli/shared/src/lib/infrastructure/config.reporitory.js +0 -51
- package/libs/cli/shared/src/lib/infrastructure/formatters/console-formatter.js +0 -96
- package/libs/cli/shared/src/lib/infrastructure/formatters/index.js +0 -41
- package/libs/cli/shared/src/lib/infrastructure/formatters/json-formatter.js +0 -64
- package/libs/cli/shared/src/lib/infrastructure/formatters/markdown-formatter.js +0 -120
- package/libs/cli/shared/src/lib/infrastructure/formatters/types.js +0 -15
- package/libs/cli/shared/src/lib/infrastructure/formatters/utils.js +0 -72
- package/libs/cli/shared/src/lib/infrastructure/git.js +0 -147
- package/libs/cli/shared/src/lib/infrastructure/http.js +0 -257
- package/libs/cli/shared/src/lib/infrastructure/markdown.js +0 -95
- package/libs/cli/shared/src/lib/infrastructure/transformers/embeddings.js +0 -88
- package/libs/cli/shared/src/lib/infrastructure/transformers/index.js +0 -25
- package/libs/cli/shared/src/lib/infrastructure/transformers/rag-eval.js +0 -154
- package/libs/cli/shared/src/lib/infrastructure/transformers/similarity.js +0 -210
- package/libs/cli/shared/src/lib/infrastructure/workspace.js +0 -297
- package/libs/cli/shared/src/lib/infrastructure/yaml.js +0 -237
- package/libs/cli/shared/src/lib/lowgular.config.js +0 -120
- package/libs/cli/shared/src/lib/token.js +0 -135
- package/libs/cli/shared/src/lib/utils/solution.util.js +0 -35
- package/libs/cli/shared/src/lib/utils/utils.js +0 -89
- package/libs/cli/typescript/src/index.js +0 -21
- package/libs/cli/typescript/src/lib/base/index.js +0 -23
- package/libs/cli/typescript/src/lib/base/nameable.js +0 -34
- package/libs/cli/typescript/src/lib/base/nodeable.js +0 -36
- package/libs/cli/typescript/src/lib/class.implementation.js +0 -52
- package/libs/cli/typescript/src/lib/core/declaration.registry.js +0 -107
- package/libs/cli/typescript/src/lib/core/design-pattern.js +0 -55
- package/libs/cli/typescript/src/lib/core/index.js +0 -35
- package/libs/cli/typescript/src/lib/core/navigable-declaration.js +0 -69
- package/libs/cli/typescript/src/lib/core/program-context.js +0 -71
- package/libs/cli/typescript/src/lib/core/syntax-kind.utils.js +0 -40
- package/libs/cli/typescript/src/lib/core/type.js +0 -374
- package/libs/cli/typescript/src/lib/declaration.abstraction.js +0 -90
- package/libs/cli/typescript/src/lib/decorator.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/enum.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/function-declaration.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/index.js +0 -57
- package/libs/cli/typescript/src/lib/interface.implementation.js +0 -51
- package/libs/cli/typescript/src/lib/members/method-abstraction.resolver.js +0 -90
- package/libs/cli/typescript/src/lib/members/method-declaration.implementation.js +0 -44
- package/libs/cli/typescript/src/lib/members/method-signature.implementation.js +0 -46
- package/libs/cli/typescript/src/lib/members/method.util.js +0 -32
- package/libs/cli/typescript/src/lib/members/parameter.implementation.js +0 -38
- package/libs/cli/typescript/src/lib/members/property-declaration.implementation.js +0 -64
- package/libs/cli/typescript/src/lib/members/property-signature.implementation.js +0 -34
- package/libs/cli/typescript/src/lib/members/property.util.js +0 -61
- package/libs/cli/typescript/src/lib/members/statements/expressions/binary-expression.implementation.js +0 -42
- package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js +0 -114
- package/libs/cli/typescript/src/lib/members/statements/expressions/expression.abstraction.js +0 -188
- package/libs/cli/typescript/src/lib/members/statements/expressions/property-access-expression.implementation.js +0 -35
- package/libs/cli/typescript/src/lib/members/statements/expressions/unary-expression.implementation.js +0 -51
- package/libs/cli/typescript/src/lib/members/statements/statement.implementation.js +0 -49
- package/libs/cli/typescript/src/lib/members/statements/utils.js +0 -51
- package/libs/cli/typescript/src/lib/plugins/built-in.plugin.js +0 -258
- package/libs/cli/typescript/src/lib/plugins/plugin.interface.js +0 -15
- package/libs/cli/typescript/src/lib/plugins/rxjs.plugin.js +0 -228
- package/libs/cli/typescript/src/lib/plugins/signal.plugin.js +0 -126
- package/libs/cli/typescript/src/lib/plugins/stubs.js +0 -66
- package/libs/cli/typescript/src/lib/type-alias.implementation.js +0 -72
- package/libs/cli/typescript/src/lib/utils.js +0 -39
- package/libs/cli/typescript/src/lib/variable-declaration.implementation.js +0 -35
- package/libs/core/codegular/src/index.js +0 -21
- package/libs/core/codegular/src/lib/index.js +0 -29
- package/libs/core/codegular/src/lib/node.js +0 -112
- package/libs/core/codegular/src/lib/program.js +0 -92
- package/libs/core/codegular/src/lib/string.js +0 -168
- package/libs/core/codegular/src/lib/type-checker.js +0 -170
- package/libs/core/codegular/src/lib/utils.js +0 -347
- package/main.js +0 -43
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var method_abstraction_resolver_exports = {};
|
|
29
|
-
__export(method_abstraction_resolver_exports, {
|
|
30
|
-
resolveMethodAbstraction: () => resolveMethodAbstraction
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(method_abstraction_resolver_exports);
|
|
33
|
-
var import_codegular = require("@core/codegular");
|
|
34
|
-
var ts = __toESM(require("typescript"));
|
|
35
|
-
var import_method = require("./method.util");
|
|
36
|
-
var import_expression = require("./statements/expressions/expression.abstraction");
|
|
37
|
-
const isCommandByName = (methodName) => {
|
|
38
|
-
const commandPattern = /^(set|update|delete|create|add|remove|publish|send|execute|perform|save|store|clear|reset|initialize)/i;
|
|
39
|
-
return commandPattern.test(methodName);
|
|
40
|
-
};
|
|
41
|
-
const isQueryByName = (methodName) => {
|
|
42
|
-
const queryPattern = /^(get|find|search|fetch|read|is|has|can|should|will|list|count|calculate|compute)/i;
|
|
43
|
-
return queryPattern.test(methodName);
|
|
44
|
-
};
|
|
45
|
-
const simpleStrategy = (config) => {
|
|
46
|
-
if (config.bodyMutationCounter[import_expression.ExpressionAbstraction.MUTATING] > 0) {
|
|
47
|
-
return import_method.MethodImplementationAbstraction.COMMAND;
|
|
48
|
-
}
|
|
49
|
-
if (config.bodyMutationCounter[import_expression.ExpressionAbstraction.NON_MUTATING] > 0) {
|
|
50
|
-
return import_method.MethodImplementationAbstraction.QUERY;
|
|
51
|
-
}
|
|
52
|
-
if (config.isReturnTypeVoidable && isCommandByName(config.methodName)) {
|
|
53
|
-
return import_method.MethodImplementationAbstraction.COMMAND;
|
|
54
|
-
}
|
|
55
|
-
if (config.hasReturnStatement && isQueryByName(config.methodName)) {
|
|
56
|
-
return import_method.MethodImplementationAbstraction.QUERY;
|
|
57
|
-
}
|
|
58
|
-
return import_method.MethodImplementationAbstraction.UNKNOWN;
|
|
59
|
-
};
|
|
60
|
-
const resolveMethodAbstraction = (type, context, method) => {
|
|
61
|
-
const counts = ts.isMethodDeclaration(method) ? (0, import_expression.countExpressionAbstraction)(method.body, context) : {
|
|
62
|
-
[import_expression.ExpressionAbstraction.MUTATING]: 0,
|
|
63
|
-
[import_expression.ExpressionAbstraction.NON_MUTATING]: 0,
|
|
64
|
-
[import_expression.ExpressionAbstraction.UNKNOWN]: 0
|
|
65
|
-
};
|
|
66
|
-
const returnStatements = ts.isMethodDeclaration(method) ? (0, import_codegular.getDescendantsByKind)(
|
|
67
|
-
method.body,
|
|
68
|
-
ts.SyntaxKind.ReturnStatement
|
|
69
|
-
) : [];
|
|
70
|
-
const ancestorDeclaration = (0, import_codegular.getAncestorByKind)(method, [
|
|
71
|
-
ts.SyntaxKind.ClassDeclaration,
|
|
72
|
-
ts.SyntaxKind.InterfaceDeclaration,
|
|
73
|
-
ts.SyntaxKind.TypeAliasDeclaration
|
|
74
|
-
]);
|
|
75
|
-
const config = {
|
|
76
|
-
isReturnTypeVoidable: false,
|
|
77
|
-
// type?.abstraction === TypeInfoAbstraction.VOID ||
|
|
78
|
-
// type?.typeArgumentAbstraction === TypeInfoAbstraction.VOID,
|
|
79
|
-
hasReturnStatement: returnStatements.length > 0,
|
|
80
|
-
bodyMutationCounter: counts,
|
|
81
|
-
methodName: (0, import_codegular.getNameByIdentifier)(method),
|
|
82
|
-
ancestorDeclarationName: ancestorDeclaration ? (0, import_codegular.getNameByIdentifier)(ancestorDeclaration) : void 0
|
|
83
|
-
};
|
|
84
|
-
const abstraction = simpleStrategy(config);
|
|
85
|
-
return abstraction;
|
|
86
|
-
};
|
|
87
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
88
|
-
0 && (module.exports = {
|
|
89
|
-
resolveMethodAbstraction
|
|
90
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var method_declaration_implementation_exports = {};
|
|
19
|
-
__export(method_declaration_implementation_exports, {
|
|
20
|
-
MethodDeclarationImplementation: () => MethodDeclarationImplementation
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(method_declaration_implementation_exports);
|
|
23
|
-
var import_codegular = require("@core/codegular");
|
|
24
|
-
var import_core = require("../core");
|
|
25
|
-
var import_parameter = require("./parameter.implementation");
|
|
26
|
-
class MethodDeclarationImplementation extends import_core.NameableImpl {
|
|
27
|
-
// public readonly callExpressions: CallExpressionImplementation[];
|
|
28
|
-
// public readonly returnStatements: ReturnStatementImplementation[];
|
|
29
|
-
constructor(node, context) {
|
|
30
|
-
super(node);
|
|
31
|
-
// public readonly abstraction: MethodImplementationAbstraction;
|
|
32
|
-
this.type = void 0;
|
|
33
|
-
this.modifiers = node.modifiers?.map((m) => (0, import_codegular.getText)(m)) || [];
|
|
34
|
-
this.parameters = node.parameters.map(
|
|
35
|
-
(p) => new import_parameter.ParameterImplementation(p, context)
|
|
36
|
-
);
|
|
37
|
-
this.type = import_core.TypeImplementation.fromTsNode(node, context);
|
|
38
|
-
this.body = node.body ? (0, import_codegular.getText)(node.body) : "";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
MethodDeclarationImplementation
|
|
44
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var method_signature_implementation_exports = {};
|
|
19
|
-
__export(method_signature_implementation_exports, {
|
|
20
|
-
MethodSignatureImplementation: () => MethodSignatureImplementation
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(method_signature_implementation_exports);
|
|
23
|
-
var import_core = require("../core");
|
|
24
|
-
var import_type = require("../core/type");
|
|
25
|
-
var import_method_abstraction = require("./method-abstraction.resolver");
|
|
26
|
-
var import_method = require("./method.util");
|
|
27
|
-
var import_parameter = require("./parameter.implementation");
|
|
28
|
-
class MethodSignatureImplementation extends import_core.NameableImpl {
|
|
29
|
-
constructor(node, context) {
|
|
30
|
-
super(node);
|
|
31
|
-
this.context = context;
|
|
32
|
-
this.type = import_type.TypeImplementation.fromTsNode(node.type, this.context);
|
|
33
|
-
this.parameters = node.parameters.map(
|
|
34
|
-
(p) => new import_parameter.ParameterImplementation(p, this.context)
|
|
35
|
-
);
|
|
36
|
-
if (!this.type) {
|
|
37
|
-
this.abstraction = import_method.MethodImplementationAbstraction.UNKNOWN;
|
|
38
|
-
} else {
|
|
39
|
-
this.abstraction = (0, import_method_abstraction.resolveMethodAbstraction)(this.type, context, node);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
MethodSignatureImplementation
|
|
46
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var method_util_exports = {};
|
|
19
|
-
__export(method_util_exports, {
|
|
20
|
-
MethodImplementationAbstraction: () => MethodImplementationAbstraction
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(method_util_exports);
|
|
23
|
-
var MethodImplementationAbstraction = /* @__PURE__ */ ((MethodImplementationAbstraction2) => {
|
|
24
|
-
MethodImplementationAbstraction2["QUERY"] = "QueryMethod";
|
|
25
|
-
MethodImplementationAbstraction2["COMMAND"] = "CommandMethod";
|
|
26
|
-
MethodImplementationAbstraction2["UNKNOWN"] = "unknown";
|
|
27
|
-
return MethodImplementationAbstraction2;
|
|
28
|
-
})(MethodImplementationAbstraction || {});
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
MethodImplementationAbstraction
|
|
32
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var parameter_implementation_exports = {};
|
|
19
|
-
__export(parameter_implementation_exports, {
|
|
20
|
-
ParameterImplementation: () => ParameterImplementation
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(parameter_implementation_exports);
|
|
23
|
-
var import_core = require("../core");
|
|
24
|
-
class ParameterImplementation extends import_core.NameableImpl {
|
|
25
|
-
constructor(node, context) {
|
|
26
|
-
super(node);
|
|
27
|
-
this.context = context;
|
|
28
|
-
if (node.type) {
|
|
29
|
-
this.type = import_core.TypeImplementation.fromTsNode(node.type, this.context);
|
|
30
|
-
} else {
|
|
31
|
-
this.type = void 0;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
ParameterImplementation
|
|
38
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var property_declaration_implementation_exports = {};
|
|
19
|
-
__export(property_declaration_implementation_exports, {
|
|
20
|
-
PropertyDeclarationImplementation: () => PropertyDeclarationImplementation
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(property_declaration_implementation_exports);
|
|
23
|
-
var import_codegular = require("@core/codegular");
|
|
24
|
-
var import_core = require("../core");
|
|
25
|
-
class PropertyDeclarationImplementation extends import_core.NameableImpl {
|
|
26
|
-
constructor(node, context) {
|
|
27
|
-
super(node);
|
|
28
|
-
this.context = context;
|
|
29
|
-
this.type = void 0;
|
|
30
|
-
this.initializerText = "";
|
|
31
|
-
this.initializerCallExpressions = [];
|
|
32
|
-
this.modifiers = node.modifiers?.map((m) => (0, import_codegular.getText)(m)) || [];
|
|
33
|
-
if (node.initializer) {
|
|
34
|
-
this.initializerText = (0, import_codegular.getText)(node.initializer);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// /**
|
|
38
|
-
// * Resolves the property implementation abstraction from the type
|
|
39
|
-
// */
|
|
40
|
-
// private resolveAbstraction(): PropertyImplementationAbstraction {
|
|
41
|
-
// if (!this.type) {
|
|
42
|
-
// return PropertyImplementationAbstraction.UNKNOWN;
|
|
43
|
-
// }
|
|
44
|
-
// // Check if type is DECLARATION - then check the name
|
|
45
|
-
// if (this.type.abstraction === TypeInfoAbstraction.DECLARATION) {
|
|
46
|
-
// const typeName = this.getTypeName();
|
|
47
|
-
// if (typeName) {
|
|
48
|
-
// // Check for reactive patterns
|
|
49
|
-
// if (/(Subject|BehaviorSubject|ReplaySubject|Signal)/.test(typeName)) {
|
|
50
|
-
// return PropertyImplementationAbstraction.REACTIVE;
|
|
51
|
-
// }
|
|
52
|
-
// // Check for observable patterns
|
|
53
|
-
// if (/Observable/.test(typeName)) {
|
|
54
|
-
// return PropertyImplementationAbstraction.OBSERVABLE;
|
|
55
|
-
// }
|
|
56
|
-
// }
|
|
57
|
-
// }
|
|
58
|
-
// return PropertyImplementationAbstraction.UNKNOWN;
|
|
59
|
-
// }
|
|
60
|
-
}
|
|
61
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
-
0 && (module.exports = {
|
|
63
|
-
PropertyDeclarationImplementation
|
|
64
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var property_signature_implementation_exports = {};
|
|
19
|
-
__export(property_signature_implementation_exports, {
|
|
20
|
-
PropertySignatureImplementation: () => PropertySignatureImplementation
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(property_signature_implementation_exports);
|
|
23
|
-
var import_core = require("../core");
|
|
24
|
-
class PropertySignatureImplementation extends import_core.NameableImpl {
|
|
25
|
-
constructor(node, context) {
|
|
26
|
-
super(node);
|
|
27
|
-
this.context = context;
|
|
28
|
-
this.type = import_core.TypeImplementation.fromTsNode(node, this.context);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
PropertySignatureImplementation
|
|
34
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var property_util_exports = {};
|
|
19
|
-
__export(property_util_exports, {
|
|
20
|
-
PropertyImplementationAbstraction: () => PropertyImplementationAbstraction,
|
|
21
|
-
resolveAbstraction: () => resolveAbstraction
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(property_util_exports);
|
|
24
|
-
var import_codegular = require("@core/codegular");
|
|
25
|
-
const ts = require("typescript");
|
|
26
|
-
const isReactive = (node) => {
|
|
27
|
-
const initializerText = (0, import_codegular.getNameByIdentifier)(node);
|
|
28
|
-
const matchers = [/(Subject|BehaviorSubject|ReplaySubject|Signal)/];
|
|
29
|
-
return matchers.find((matcher) => initializerText.match(matcher) !== null) !== void 0;
|
|
30
|
-
};
|
|
31
|
-
const isObservable = (node) => {
|
|
32
|
-
const initializerText = (0, import_codegular.getNameByIdentifier)(node);
|
|
33
|
-
const matchers = [/Observable/];
|
|
34
|
-
return matchers.find((matcher) => initializerText.match(matcher) !== null) !== void 0;
|
|
35
|
-
};
|
|
36
|
-
const resolveAbstraction = (node) => {
|
|
37
|
-
if (!node) {
|
|
38
|
-
return "unknown" /* UNKNOWN */;
|
|
39
|
-
}
|
|
40
|
-
if (isReactive(node)) {
|
|
41
|
-
return "ReactiveProperty" /* REACTIVE */;
|
|
42
|
-
}
|
|
43
|
-
if (isObservable(node)) {
|
|
44
|
-
return "ObservableProperty" /* OBSERVABLE */;
|
|
45
|
-
}
|
|
46
|
-
return "unknown" /* UNKNOWN */;
|
|
47
|
-
};
|
|
48
|
-
var PropertyImplementationAbstraction = /* @__PURE__ */ ((PropertyImplementationAbstraction2) => {
|
|
49
|
-
PropertyImplementationAbstraction2["PRIMITIVE"] = "PrimitiveProperty";
|
|
50
|
-
PropertyImplementationAbstraction2["REACTIVE"] = "ReactiveProperty";
|
|
51
|
-
PropertyImplementationAbstraction2["DICTIONARY"] = "DictionaryProperty";
|
|
52
|
-
PropertyImplementationAbstraction2["OBSERVABLE"] = "ObservableProperty";
|
|
53
|
-
PropertyImplementationAbstraction2["DEPENDENCY"] = "DependencyProperty";
|
|
54
|
-
PropertyImplementationAbstraction2["UNKNOWN"] = "unknown";
|
|
55
|
-
return PropertyImplementationAbstraction2;
|
|
56
|
-
})(PropertyImplementationAbstraction || {});
|
|
57
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
0 && (module.exports = {
|
|
59
|
-
PropertyImplementationAbstraction,
|
|
60
|
-
resolveAbstraction
|
|
61
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var binary_expression_implementation_exports = {};
|
|
19
|
-
__export(binary_expression_implementation_exports, {
|
|
20
|
-
BinaryExpressionImplementation: () => BinaryExpressionImplementation
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(binary_expression_implementation_exports);
|
|
23
|
-
var import_core = require("../../../core");
|
|
24
|
-
var import_expression = require("./expression.abstraction");
|
|
25
|
-
const ts = require("typescript");
|
|
26
|
-
class BinaryExpressionImplementation extends import_core.NodableImpl {
|
|
27
|
-
constructor(node, context) {
|
|
28
|
-
super(node);
|
|
29
|
-
if (this.isMutating(node)) {
|
|
30
|
-
this.abstraction = import_expression.ExpressionAbstraction.MUTATING;
|
|
31
|
-
} else {
|
|
32
|
-
this.abstraction = import_expression.ExpressionAbstraction.NON_MUTATING;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
isMutating(node) {
|
|
36
|
-
return node.operatorToken.kind === ts.SyntaxKind.EqualsToken || node.operatorToken.kind === ts.SyntaxKind.PlusEqualsToken || node.operatorToken.kind === ts.SyntaxKind.MinusEqualsToken || node.operatorToken.kind === ts.SyntaxKind.AsteriskEqualsToken || node.operatorToken.kind === ts.SyntaxKind.AsteriskAsteriskEqualsToken || node.operatorToken.kind === ts.SyntaxKind.SlashEqualsToken || node.operatorToken.kind === ts.SyntaxKind.PercentEqualsToken || node.operatorToken.kind === ts.SyntaxKind.LessThanLessThanEqualsToken || node.operatorToken.kind === ts.SyntaxKind.GreaterThanGreaterThanEqualsToken || node.operatorToken.kind === ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken || node.operatorToken.kind === ts.SyntaxKind.AmpersandEqualsToken || node.operatorToken.kind === ts.SyntaxKind.BarEqualsToken || node.operatorToken.kind === ts.SyntaxKind.CaretEqualsToken || node.operatorToken.kind === ts.SyntaxKind.BarBarEqualsToken || node.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandEqualsToken || node.operatorToken.kind === ts.SyntaxKind.QuestionQuestionEqualsToken;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
BinaryExpressionImplementation
|
|
42
|
-
});
|
package/libs/cli/typescript/src/lib/members/statements/expressions/call-expression.implementation.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var call_expression_implementation_exports = {};
|
|
29
|
-
__export(call_expression_implementation_exports, {
|
|
30
|
-
CallExpressionImplementation: () => CallExpressionImplementation,
|
|
31
|
-
resolveCallExpressionMethod: () => resolveCallExpressionMethod
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(call_expression_implementation_exports);
|
|
34
|
-
var import_codegular = require("@core/codegular");
|
|
35
|
-
var ts = __toESM(require("typescript"));
|
|
36
|
-
var import_core = require("../../../core");
|
|
37
|
-
var import_method_declaration = require("../../method-declaration.implementation");
|
|
38
|
-
var import_method_signature = require("../../method-signature.implementation");
|
|
39
|
-
var import_expression = require("./expression.abstraction");
|
|
40
|
-
const resolveCallExpressionMethod = (callExpr, context) => {
|
|
41
|
-
if (!ts.isPropertyAccessExpression(callExpr.expression)) {
|
|
42
|
-
return void 0;
|
|
43
|
-
}
|
|
44
|
-
const methodName = callExpr.expression.name.text;
|
|
45
|
-
const objectExpr = callExpr.expression.expression;
|
|
46
|
-
const methodDeclaration = (0, import_codegular.getDeclarationFromValueSymbol)(
|
|
47
|
-
callExpr.expression.name,
|
|
48
|
-
context
|
|
49
|
-
);
|
|
50
|
-
if (methodDeclaration) {
|
|
51
|
-
const parentDeclaration = (0, import_codegular.getAncestorByKind)(methodDeclaration, [
|
|
52
|
-
ts.SyntaxKind.ClassDeclaration,
|
|
53
|
-
ts.SyntaxKind.InterfaceDeclaration,
|
|
54
|
-
ts.SyntaxKind.TypeAliasDeclaration
|
|
55
|
-
]);
|
|
56
|
-
if (parentDeclaration) {
|
|
57
|
-
const implementation = context.declarationRegistry.getFromDeclaration(
|
|
58
|
-
parentDeclaration,
|
|
59
|
-
context
|
|
60
|
-
);
|
|
61
|
-
if (implementation) {
|
|
62
|
-
const method = implementation.methods.find(
|
|
63
|
-
(m) => m.name === methodName
|
|
64
|
-
);
|
|
65
|
-
if (method) {
|
|
66
|
-
return method;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (ts.isMethodDeclaration(methodDeclaration)) {
|
|
71
|
-
return new import_method_declaration.MethodDeclarationImplementation(methodDeclaration, context);
|
|
72
|
-
}
|
|
73
|
-
if (ts.isMethodSignature(methodDeclaration)) {
|
|
74
|
-
return new import_method_signature.MethodSignatureImplementation(methodDeclaration, context);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
const objectDeclaration = (0, import_codegular.getDeclarationFromTypeLocation)(objectExpr, context);
|
|
78
|
-
if (objectDeclaration) {
|
|
79
|
-
const implementation = context.declarationRegistry.getFromDeclaration(
|
|
80
|
-
objectDeclaration,
|
|
81
|
-
context
|
|
82
|
-
);
|
|
83
|
-
if (implementation) {
|
|
84
|
-
const method = implementation.methods.find((m) => m.name === methodName);
|
|
85
|
-
if (method) {
|
|
86
|
-
return method;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
throw new Error(
|
|
91
|
-
`Could not resolve method ${methodName} from call expression ${(0, import_codegular.getText)(callExpr)} in ${callExpr.expression.getSourceFile()?.fileName}`
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
class CallExpressionImplementation extends import_core.NodableImpl {
|
|
95
|
-
constructor(node, context) {
|
|
96
|
-
super(node);
|
|
97
|
-
this.arguments = Array.from(node.arguments).map((a) => {
|
|
98
|
-
return {
|
|
99
|
-
name: (0, import_codegular.getNameByIdentifier)(a)
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
this.method = resolveCallExpressionMethod(node, context);
|
|
103
|
-
if (this.method) {
|
|
104
|
-
this.abstraction = import_expression.ExpressionAbstraction.UNKNOWN;
|
|
105
|
-
} else {
|
|
106
|
-
this.abstraction = import_expression.ExpressionAbstraction.NON_MUTATING;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
111
|
-
0 && (module.exports = {
|
|
112
|
-
CallExpressionImplementation,
|
|
113
|
-
resolveCallExpressionMethod
|
|
114
|
-
});
|