@rxap/ts-morph
Version:
Provides utilities for manipulating TypeScript code using the ts-morph library. It offers a fluent API to add, modify, and remove code elements such as classes, decorators, imports, and properties in both Angular and NestJS projects. This package simplifi
26 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoerceAppRoutes = CoerceAppRoutes;
const ts_morph_1 = require("ts-morph");
const coerce_imports_1 = require("../coerce-imports");
const coerce_routes_1 = require("./coerce-routes");
function CoerceAppRoutes(sourceFile, options = {}) {
var _a, _b;
const variableDeclaration = (0, coerce_routes_1.CoerceRoutes)(sourceFile, Object.assign(Object.assign({}, options), { name: (_a = options.name) !== null && _a !== void 0 ? _a : 'appRoutes', initializer: (_b = options.initializer) !== null && _b !== void 0 ? _b : (w => {
w.writeLine('[');
w.write('STATUS_CHECK_ROUTE,');
ts_morph_1.Writers.object({
path: w => w.quote('**'),
redirectTo: w => w.quote('')
})(w);
w.write(']');
}) }));
(0, coerce_imports_1.CoerceImports)(sourceFile, [
{
namedImports: ['STATUS_CHECK_ROUTE'],
moduleSpecifier: '@rxap/ngx-status-check'
},
]);
return variableDeclaration;
}
//# sourceMappingURL=coerce-app-routes.js.map