@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>
18 lines • 650 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractDefaultExportName = extractDefaultExportName;
/**
* Extracts the category name from the given file path.
* @param tree
* @param {string} filePath The file path.
* @returns {string | null} The category name.
*/
function extractDefaultExportName(tree, filePath) {
if (tree.get(filePath)) {
const fileContent = tree.readText(filePath);
const matchResult = /export\s*default\s*(\w*)/gm.exec(fileContent);
return matchResult ? matchResult[1] : null;
}
return null;
}
//# sourceMappingURL=extract-default-export-name.js.map