@ng-doc/builder
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
33 lines • 1.02 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMethodChain = getMethodChain;
const ts_morph_1 = require("ts-morph");
const class_1 = require("../class");
const for_all_interfaces_1 = require("../interface/for-all-interfaces");
/**
*
* @param method
*/
function getMethodChain(method) {
const parent = method.getParent();
const methods = [];
if (ts_morph_1.Node.isClassDeclaration(parent)) {
(0, class_1.forAllClasses)(parent, (cls) => {
const mtd = cls.getMethod(method.getName());
if (mtd) {
methods.push(mtd);
}
});
// TODO: Add interfaces
}
if (ts_morph_1.Node.isInterfaceDeclaration(parent)) {
(0, for_all_interfaces_1.forAllInterfaces)(parent, (int) => {
const mtd = int.getMethod(method.getName());
if (mtd) {
methods.push(mtd);
}
});
}
return methods;
}
//# sourceMappingURL=get-method-chain.js.map
;