@living-architecture/riviere-extract-ts 0.4.2 → 0.4.3
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.
|
@@ -86,11 +86,7 @@ function evaluateClassRule(rule, classDecl) {
|
|
|
86
86
|
if ('fromClassName' in rule) {
|
|
87
87
|
return evaluateFromClassNameRule(rule, classDecl);
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
if (!('fromProperty' in rule)) {
|
|
91
|
-
throw new ExtractionError('Unsupported extraction rule type for class-based component', classDecl.getSourceFile().getFilePath(), classDecl.getStartLineNumber());
|
|
92
|
-
}
|
|
93
|
-
return evaluateFromPropertyRule(rule, classDecl);
|
|
89
|
+
throw new ExtractionError('Unsupported extraction rule type for class-based component', classDecl.getSourceFile().getFilePath(), classDecl.getStartLineNumber());
|
|
94
90
|
}
|
|
95
91
|
function evaluateRule(rule, draft, project) {
|
|
96
92
|
if ('literal' in rule) {
|
|
@@ -107,6 +103,10 @@ function evaluateRule(rule, draft, project) {
|
|
|
107
103
|
const classDecl = findContainingClass(project, draft);
|
|
108
104
|
return evaluateFromGenericArgRule(rule, classDecl);
|
|
109
105
|
}
|
|
106
|
+
if ('fromProperty' in rule) {
|
|
107
|
+
const classDecl = findContainingClass(project, draft);
|
|
108
|
+
return evaluateFromPropertyRule(rule, classDecl);
|
|
109
|
+
}
|
|
110
110
|
if ('fromParameterType' in rule) {
|
|
111
111
|
const methodDecl = findMethodAtLine(project, draft);
|
|
112
112
|
const params = methodDecl.getParameters();
|