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

14 lines 598 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CoerceClassProperty = CoerceClassProperty; /** * @deprecated import 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