@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
12 lines • 544 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoerceParameterDeclaration = CoerceParameterDeclaration;
function CoerceParameterDeclaration(node, name, structure) {
let parameterDeclaration = node.getParameter(name);
if (!parameterDeclaration) {
parameterDeclaration = node.addParameter({ name });
parameterDeclaration.set(structure !== null && structure !== void 0 ? structure : {});
}
return parameterDeclaration;
}
//# sourceMappingURL=coerce-parameter-declaration.js.map