@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
14 lines • 642 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoerceClassProperty = CoerceClassProperty;
/**
* @deprecated instead use the CoercePropertyDeclaration function from @rxap/ts-morph
*/
function CoerceClassProperty(classDeclaration, propertyName, propertyStructure) {
let propertyDeclaration = classDeclaration.getProperty(propertyName);
if (!propertyDeclaration) {
propertyDeclaration = classDeclaration.insertProperty(0, Object.assign(Object.assign({}, propertyStructure), { name: propertyName }));
}
return propertyDeclaration;
}
//# sourceMappingURL=coerce-class-property.js.map