@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
13 lines • 514 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoerceClassConstructor = CoerceClassConstructor;
function CoerceClassConstructor(classDeclaration) {
const constructorDeclarations = classDeclaration.getConstructors();
if (constructorDeclarations.length === 0) {
constructorDeclarations.push(classDeclaration.addConstructor({
parameters: [],
}));
}
return constructorDeclarations;
}
//# sourceMappingURL=coerce-class-constructor.js.map