UNPKG

1.16 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var ObjectUtils_1 = require("../util/ObjectUtils");
4/**
5 */
6var Alias = /** @class */ (function () {
7 function Alias(alias) {
8 ObjectUtils_1.ObjectUtils.assign(this, alias || {});
9 }
10 Object.defineProperty(Alias.prototype, "target", {
11 get: function () {
12 return this.metadata.target;
13 },
14 enumerable: true,
15 configurable: true
16 });
17 Object.defineProperty(Alias.prototype, "hasMetadata", {
18 get: function () {
19 return !!this._metadata;
20 },
21 enumerable: true,
22 configurable: true
23 });
24 Object.defineProperty(Alias.prototype, "metadata", {
25 get: function () {
26 if (!this._metadata)
27 throw new Error("Cannot get entity metadata for the given alias \"" + this.name + "\"");
28 return this._metadata;
29 },
30 set: function (metadata) {
31 this._metadata = metadata;
32 },
33 enumerable: true,
34 configurable: true
35 });
36 return Alias;
37}());
38exports.Alias = Alias;
39
40//# sourceMappingURL=Alias.js.map