@rxap/ts-morph
Version:
Provides utilities for manipulating TypeScript code using the ts-morph library. It offers a fluent API to add, modify, and remove code elements such as classes, decorators, imports, and properties in both Angular and NestJS projects. This package simplifi
30 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NormalizeDataClassProperty = NormalizeDataClassProperty;
const ts_morph_1 = require("@rxap/ts-morph");
const data_property_1 = require("../data-property");
function NormalizeDataClassProperty(property) {
var _a;
const { name, type, isArray, memberList, source, isOptional, } = (0, data_property_1.NormalizeDataProperty)(property);
let isType = (_a = property.isType) !== null && _a !== void 0 ? _a : false;
if ([ts_morph_1.TypeNames.Self, ts_morph_1.TypeNames.Deferred].includes(type.name)) {
isType = true;
}
switch (type.name) {
case 'IconConfig':
type.name = 'IconDto';
type.moduleSpecifier = '@rxap/nest-dto';
isType = true;
break;
}
return {
source,
memberList,
name,
type,
isArray,
isType,
isOptional,
};
}
//# sourceMappingURL=dto-class-property.js.map