mapdtotoentity
Version:
A tiny typescript package to map data transfer objects to entity class. (Especially TypeOrm entities)
15 lines (14 loc) • 487 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var mapDtoValuesToEntity = /** @class */ (function () {
function mapDtoValuesToEntity() {
}
mapDtoValuesToEntity.prototype.map = function (DTOInstance, Entity) {
Object.keys(DTOInstance).forEach(function (key) {
Entity[key] = DTOInstance[key];
});
return Entity;
};
return mapDtoValuesToEntity;
}());
exports.mapDtoValuesToEntity = mapDtoValuesToEntity;