dependency-injection-cat
Version:
DI Cat is a truly clean DI-container, which allows you not to pollute your business logic with decorators from DI/IOC libraries!
22 lines (21 loc) • 1.09 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.isContainerAccess = void 0;
var typescript_1 = __importDefault(require("typescript"));
var node_source_descriptor_1 = require("../node-source-descriptor");
var libraryName_1 = require("../../../constants/libraryName");
var isContainerAccess = function (node) {
if (typescript_1.default.isCallExpression(node) && typescript_1.default.isPropertyAccessExpression(node.expression) && typescript_1.default.isIdentifier(node.expression.expression)) {
var nodeDescriptor = (0, node_source_descriptor_1.getNodeSourceDescriptorDeep)(node.getSourceFile(), node.expression.expression.getText());
if (nodeDescriptor === null) {
return false;
}
return nodeDescriptor.path === libraryName_1.libraryName
&& nodeDescriptor.name === 'container';
}
return false;
};
exports.isContainerAccess = isContainerAccess;