@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>
26 lines • 895 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEntryRoute = getEntryRoute;
const tslib_1 = require("tslib");
const core_1 = require("@ng-doc/core");
const path_1 = tslib_1.__importDefault(require("path"));
const interfaces_1 = require("../interfaces");
/**
*
* @param entry
* @param filePath
*/
function getEntryRoute(entry, filePath) {
const dirName = path_1.default.basename(path_1.default.dirname(filePath));
if ((0, interfaces_1.isPageEntry)(entry, filePath)) {
return ((0, core_1.isRoute)(entry?.route) ? entry?.route.path : entry?.route) ?? dirName;
}
if ((0, interfaces_1.isApiEntry)(entry, filePath)) {
return entry.route ?? 'api';
}
if ((0, interfaces_1.isCategoryEntry)(entry, filePath)) {
return entry.route ?? dirName;
}
return dirName;
}
//# sourceMappingURL=get-entry-route.js.map
;