UNPKG

@rxap/schematics-ts-morph

Version:

This package provides utilities for manipulating TypeScript code using ts-morph, particularly for Angular and NestJS projects. It offers functions to add, coerce, and modify code elements like classes, methods, decorators, and imports. The package also in

24 lines 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HasAccordionComponent = HasAccordionComponent; const schematics_1 = require("@angular-devkit/schematics"); const workspace_utilities_1 = require("@rxap/workspace-utilities"); const has_project_feature_1 = require("./has-project-feature"); const path_1 = require("path"); function HasAccordionComponent(host, options) { const { accordionName, project, feature, } = options; if (!(0, workspace_utilities_1.HasProject)(host, project)) { throw new schematics_1.SchematicsException(`The accordion component '${accordionName}' does not exists. The project '${project}' does not exists.`); } if (!(0, has_project_feature_1.HasProjectFeature)(host, options)) { throw new schematics_1.SchematicsException(`The accordion component '${accordionName}' does not exists. The project '${project}' has not the feature does not exists.`); } const projectSourceRoot = (0, workspace_utilities_1.GetProjectSourceRoot)(host, options.project); if (feature) { return host.exists((0, path_1.join)(projectSourceRoot, 'feature', feature, accordionName, accordionName + '.component.ts')); } else { return host.exists((0, path_1.join)(projectSourceRoot, 'app', accordionName, accordionName + '.component.ts')); } } //# sourceMappingURL=has-accordion-component.js.map