1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var ObjectUtils_1 = require("../util/ObjectUtils");
|
4 |
|
5 |
|
6 | var Alias = (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 | }());
|
38 | exports.Alias = Alias;
|
39 |
|
40 |
|