@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 • 705 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OverwriteDecorator = OverwriteDecorator;
/**
* Overwrite the decorator of a control property.
*
* @param {PropertyDeclaration} controlProperty - The control property to overwrite the decorator for.
* @param {OptionalKind<DecoratorStructure>} structure - The new decorator structure to use.
* @return {void}
*/
function OverwriteDecorator(controlProperty, structure) {
const decorator = controlProperty.getDecorator(structure.name);
decorator === null || decorator === void 0 ? void 0 : decorator.remove();
controlProperty.insertDecorator(0, structure);
}
//# sourceMappingURL=overwrite-decorator.js.map