@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 • 513 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoerceClass = CoerceClass;
/**
* @deprecated import from @rxap/ts-morph
*/
function CoerceClass(sourceFile, className, classStructure = {}) {
let classDeclaration = sourceFile.getClass(className);
if (!classDeclaration) {
classDeclaration = sourceFile.addClass(Object.assign(Object.assign({}, classStructure), { name: className }));
}
return classDeclaration;
}
//# sourceMappingURL=coerce-class.js.map