@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>
27 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.generate = generate;
const schematics_1 = require("@angular-devkit/schematics");
/**
* Generates the NgDocApi entity
* @param {NgDocBuildPageSchema} options - The options to generate the API
* @returns {Rule} Angular Schematic Rule
*/
function generate(options) {
return (host) => {
const execPath = options?.path ?? '';
return (0, schematics_1.chain)([
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
(0, schematics_1.applyTemplates)({ ...options }),
(0, schematics_1.move)(execPath),
(0, schematics_1.forEach)((fileEntry) => {
if (host.exists(fileEntry.path)) {
host.overwrite(fileEntry.path, fileEntry.content);
}
return fileEntry;
}),
]), schematics_1.MergeStrategy.Overwrite),
]);
};
}
//# sourceMappingURL=index.js.map