@lxdhub/dbsync
Version:
Display, search and copy LXD-images using a web interface.
36 lines • 1.5 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const db_1 = require("@lxdhub/db");
const common_1 = require("@nestjs/common");
/**
* Factory which prodcues RemoteDtos
*/
let RemoteFactory = class RemoteFactory {
/**
* Maps the given RemoteDto with the database Remote and returns
* the instance
* @param image The RemoteDto, which should be mapped with a database Remote
*/
dtoToEntity(externalRemote, localRemote) {
// Aliases
const lR = localRemote || new db_1.Remote();
const eR = externalRemote;
lR.name = eR.name;
lR.protocol = eR.protocol;
lR.public = eR.public;
lR.readonly = eR.readonly;
lR.serverUrl = eR.url;
return lR;
}
};
RemoteFactory = __decorate([
common_1.Injectable()
], RemoteFactory);
exports.RemoteFactory = RemoteFactory;
//# sourceMappingURL=remote.factory.js.map