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

16 lines 637 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FindRoutingModule = FindRoutingModule; const path_1 = require("path"); function FindRoutingModule(tree, basePath) { var _a; const baseDir = tree.getDir(basePath); for (const file of baseDir.subfiles) { const filePath = (0, path_1.join)(basePath, file); if ((_a = tree.read(filePath)) === null || _a === void 0 ? void 0 : _a.toString('utf-8').match(/routes:\s?Routes/i)) { return filePath; } } throw new Error('Could not find the routing module'); } //# sourceMappingURL=find-routing-module.js.map