technical-debt-radar 1.6.0 → 1.6.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/dist/index.js +11 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16282,12 +16282,21 @@ var require_reliability_detector = __commonJS({
|
|
|
16282
16282
|
}
|
|
16283
16283
|
return false;
|
|
16284
16284
|
}
|
|
16285
|
+
function isNestJSInjectable(classNode) {
|
|
16286
|
+
return classNode.getDecorators().some((d) => d.getName() === "Injectable");
|
|
16287
|
+
}
|
|
16285
16288
|
function isNestJSController(classNode) {
|
|
16286
16289
|
return classNode.getDecorators().some((d) => {
|
|
16287
16290
|
const name = d.getName();
|
|
16288
16291
|
return name === "Controller" || name === "Resolver";
|
|
16289
16292
|
});
|
|
16290
16293
|
}
|
|
16294
|
+
function isInsideNestJSInjectable(node) {
|
|
16295
|
+
const classDecl = node.getFirstAncestorByKind(ts_morph_1.SyntaxKind.ClassDeclaration);
|
|
16296
|
+
if (!classDecl)
|
|
16297
|
+
return false;
|
|
16298
|
+
return isNestJSInjectable(classDecl);
|
|
16299
|
+
}
|
|
16291
16300
|
function fileImportsNestJS(sourceFile) {
|
|
16292
16301
|
for (const decl of sourceFile.getImportDeclarations()) {
|
|
16293
16302
|
const spec = decl.getModuleSpecifierValue();
|
|
@@ -16398,6 +16407,8 @@ var require_reliability_detector = __commonJS({
|
|
|
16398
16407
|
return;
|
|
16399
16408
|
if (isNestJSControllerMethod(node, sourceFile))
|
|
16400
16409
|
return;
|
|
16410
|
+
if (fileImportsNestJS(sourceFile) && isInsideNestJSInjectable(node))
|
|
16411
|
+
return;
|
|
16401
16412
|
if (functionHasTryCatch(fn.node))
|
|
16402
16413
|
return;
|
|
16403
16414
|
const isRisky = isRiskyAwaitCall(node);
|