@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
9 lines • 393 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoerceFunction = CoerceFunction;
function CoerceFunction(sourceFile, name, structure = {}) {
const functionDeclaration = sourceFile.getFunction(name) || sourceFile.addFunction({ name });
functionDeclaration.set(structure);
return functionDeclaration;
}
//# sourceMappingURL=coerce-function.js.map