xml-model 0.2.4 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/main/defaults/models.js +2 -2
- package/build/main/helper/merge-maps.d.ts +1 -0
- package/build/main/helper/merge-maps.js +42 -0
- package/build/main/model/index.js +38 -36
- package/build/main/model/property.js +13 -10
- package/build/main/model/types.js +27 -27
- package/build/main/model.spec.js +12 -12
- package/build/module/defaults/models.js +2 -2
- package/build/module/helper/merge-maps.d.ts +1 -0
- package/build/module/helper/merge-maps.js +39 -0
- package/build/module/model/index.js +38 -36
- package/build/module/model/property.js +13 -10
- package/build/module/model/types.js +27 -27
- package/build/module/model.spec.js +12 -12
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
15
15
|
__RΦ.t[id] = t = l;
|
|
16
16
|
}
|
|
17
17
|
return t;
|
|
18
|
-
}, t: { [4]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => require("../types").IΦXMLElement }, [13]: { LΦ: t => String }, [14]: { LΦ: t => Number }, [
|
|
18
|
+
}, t: { [4]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => require("../types").IΦXMLElement }, [13]: { LΦ: t => String }, [14]: { LΦ: t => Number }, [1698]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(3179) }] }) }, [3179]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(3177) }) }, [3177]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(13) }, { n: "name", f: "", t: __RΦ.a(13) }] }) }, [20]: { LΦ: t => Boolean } } };
|
|
19
19
|
const model_1 = require("../model");
|
|
20
20
|
const xml_1 = require("../xml");
|
|
21
21
|
// string is <string>value</string>
|
|
@@ -48,7 +48,7 @@ const xml_1 = require("../xml");
|
|
|
48
48
|
Object.assign({ type: "element", name: "boolean" }, (0, xml_1.fromContent)(String(ctx.object))),
|
|
49
49
|
],
|
|
50
50
|
};
|
|
51
|
-
}, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(
|
|
51
|
+
}, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1698))], "toXML"),
|
|
52
52
|
fromXML: __RΦ.f((ctx) => {
|
|
53
53
|
return Boolean((0, xml_1.getContent)(ctx.xml.elements[0]));
|
|
54
54
|
}, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(20))], "fromXML"),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function mergeMaps<K, V>(...sources: Map<K, V>[]): Map<K, V>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metadata(k, v)(t, ...a) : void 0, f: (f, d, n) => (d.forEach(d => d(f)), Object.defineProperty(f, "name", { value: n, writable: false }), f), c: (c, d, dp, dsp, n) => (d.forEach(d => d(c)), dp.forEach(([p, d]) => d(c.prototype, p)), dsp.forEach(([p, d]) => d(c, p)), n ? Object.defineProperty(c, "name", { value: n, writable: false }) : undefined, c), r: (o, a) => (Object.assign(o, a)), a: id => {
|
|
4
|
+
let t = __RΦ.t[id];
|
|
5
|
+
if (t === void 0)
|
|
6
|
+
return void 0;
|
|
7
|
+
if (t.RΦ) {
|
|
8
|
+
let r = t.RΦ;
|
|
9
|
+
delete t.RΦ;
|
|
10
|
+
__RΦ.r(t, r(t));
|
|
11
|
+
}
|
|
12
|
+
else if (t.LΦ) {
|
|
13
|
+
let l = t.LΦ();
|
|
14
|
+
delete t.LΦ;
|
|
15
|
+
__RΦ.t[id] = t = l;
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
}, t: { [1719]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(1718) }) }, [1718]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(1716), __RΦ.a(1717)] }) }, [1055]: { LΦ: t => Map }, [1716]: { LΦ: t => Object }, [1717]: { LΦ: t => Object }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [22]: { RΦ: t => ({ TΦ: "V" }) } } };
|
|
19
|
+
function mergeMaps(...sources) {
|
|
20
|
+
const res = new Map();
|
|
21
|
+
sources.forEach(__RΦ.f((source) => {
|
|
22
|
+
const overrides = new Map();
|
|
23
|
+
const additions = new Map();
|
|
24
|
+
source.forEach(__RΦ.f((val, key) => (res.has(key) ? overrides : additions).set(key, val), [__RΦ.m("rt:p", [{ n: "val", t: () => __RΦ.a(4), v: null }, { n: "key", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1718))], ""));
|
|
25
|
+
if (overrides.size) {
|
|
26
|
+
const entries = Array.from(res.entries());
|
|
27
|
+
entries.forEach(__RΦ.f((entry) => {
|
|
28
|
+
const key = entry[0];
|
|
29
|
+
if (overrides.has(key))
|
|
30
|
+
entry[1] = overrides.get(key);
|
|
31
|
+
}, [__RΦ.m("rt:p", [{ n: "entry", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
|
|
32
|
+
res.clear();
|
|
33
|
+
entries.forEach(__RΦ.f(([key, val]) => res.set(key, val), [__RΦ.m("rt:p", [{ n: "[key, val]", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1718))], ""));
|
|
34
|
+
}
|
|
35
|
+
additions.forEach(__RΦ.f((val, key) => res.set(key, val), [__RΦ.m("rt:p", [{ n: "val", t: () => __RΦ.a(4), v: null }, { n: "key", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1718))], ""));
|
|
36
|
+
}, [__RΦ.m("rt:p", [{ n: "source", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
|
|
37
|
+
return res;
|
|
38
|
+
}
|
|
39
|
+
exports.default = mergeMaps;
|
|
40
|
+
__RΦ.m("rt:p", [{ n: "sources", t: () => __RΦ.a(1719), v: null, f: "3" }])(mergeMaps);
|
|
41
|
+
__RΦ.m("rt:f", "F")(mergeMaps);
|
|
42
|
+
__RΦ.m("rt:t", () => __RΦ.a(1718))(mergeMaps);
|
|
@@ -19,7 +19,7 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
19
19
|
__RΦ.t[id] = t = l;
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
|
-
}, t: { [532]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(503)] }) }, [202]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [503]: { LΦ: t => Object }, [
|
|
22
|
+
}, t: { [532]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(503)] }) }, [202]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [503]: { LΦ: t => Object }, [1814]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1817]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1814), __RΦ.a(22), __RΦ.a(8)] }) }, [140]: { LΦ: t => Object }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [505]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1)] }) }, [502]: { TΦ: "5", name: "XMLModel" }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [1837]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1846]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(503)] }) }, [1622]: { LΦ: t => require("./types").IΦCreateXMLModelOptions }, [525]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(522), p: [__RΦ.a(503)] }) }, [522]: { LΦ: t => require("./types").IΦXMLModelOptions }, [1870]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1321)] }) }, [1321]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(422), __RΦ.a(1319)] }) }, [602]: { LΦ: t => require("./types").IΦConversionOptions }, [422]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(423), p: [__RΦ.a(421), __RΦ.a(384)] }) }, [423]: { LΦ: t => Object }, [421]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(380), p: [__RΦ.a(1)] }) }, [380]: { LΦ: t => require("./types").IΦfromXMLContext }, [384]: { LΦ: t => "properties" }, [1319]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1320), p: [__RΦ.a(1)] }) }, [1320]: { LΦ: t => Object }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [658]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(659), p: [__RΦ.a(503)] }) }, [659]: { LΦ: t => Object }, [1880]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1878)] }) }, [1878]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1353), __RΦ.a(1876)] }) }, [1353]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1354), p: [__RΦ.a(1352), __RΦ.a(384)] }) }, [1354]: { LΦ: t => Object }, [1352]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(1)] }) }, [860]: { LΦ: t => require("./types").IΦtoXMLContext }, [1876]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1877), p: [__RΦ.a(1)] }) }, [1877]: { LΦ: t => Object }, [890]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(891), p: [__RΦ.a(503)] }) }, [891]: { LΦ: t => Object }, [20]: { LΦ: t => Boolean }, [661]: { RΦ: t => ({ TΦ: "O", m: [{ n: "fromXML", f: "", t: __RΦ.a(667) }, { n: "toXML", f: "", t: __RΦ.a(898) }, { n: "options", f: "", t: __RΦ.a(1067) }] }) }, [667]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(663), __RΦ.a(665)] }) }, [663]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(664), p: [__RΦ.a(606), __RΦ.a(384)] }) }, [664]: { LΦ: t => Object }, [606]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(380), p: [__RΦ.a(523)] }) }, [523]: { LΦ: t => Object }, [665]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(666), p: [__RΦ.a(523)] }) }, [666]: { LΦ: t => Object }, [898]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(894), __RΦ.a(896)] }) }, [894]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(895), p: [__RΦ.a(863), __RΦ.a(384)] }) }, [895]: { LΦ: t => Object }, [863]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(523)] }) }, [896]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(897), p: [__RΦ.a(523)] }) }, [897]: { LΦ: t => Object }, [1067]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(1065), __RΦ.a(1066)] }) }, [1055]: { LΦ: t => Map }, [1065]: { LΦ: t => Object }, [1066]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(523)] }) }, [214]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [1896]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1894)] }) }, [1894]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1901]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1899)] }) }, [1899]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1352), __RΦ.a(111)] }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => require("../types").IΦXMLElement }, [13]: { LΦ: t => String }, [541]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(111)] }) }, [28]: { LΦ: t => Object }, [948]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(944), p: [__RΦ.a(532)] }) }, [944]: { LΦ: t => require("typescript-rtti/dist").ReflectedClass }, [1062]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(13), __RΦ.a(1061)] }) }, [1061]: { RΦ: t => ({ TΦ: "&", t: [__RΦ.a(1059), __RΦ.a(1060)] }) }, [1059]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1)] }) }, [1060]: { RΦ: t => ({ TΦ: "O", m: [{ n: "model", f: "", t: __RΦ.a(1) }] }) }, [1626]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1621)] }) }, [1621]: { LΦ: t => Object }, [1625]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(1621)] }) }, [1659]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1621)] }) }, [1822]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1819)] }) }, [1819]: { LΦ: t => Object }, [1832]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1831)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1831]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1819)] }) }, [1978]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1977)] }) }, [1977]: { LΦ: t => Object }, [1981]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1977)] }) }, [1984]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(1983)] }) }, [1983]: { LΦ: t => Object }, [1986]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1987), v: null }], f: "" }) }, [1987]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1983)] }) } } };
|
|
23
23
|
const typescript_rtti_1 = require("typescript-rtti");
|
|
24
24
|
const middleware_1 = require("../middleware");
|
|
25
25
|
const property_1 = require("./property");
|
|
@@ -40,9 +40,9 @@ function* ParentChain(constructor) {
|
|
|
40
40
|
}
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
43
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1814), v: null }])(ParentChain);
|
|
44
44
|
__RΦ.m("rt:f", "F")(ParentChain);
|
|
45
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
45
|
+
__RΦ.m("rt:t", () => __RΦ.a(1817))(ParentChain);
|
|
46
46
|
function getParentModel(model) {
|
|
47
47
|
if (model.options.parent)
|
|
48
48
|
return model.options.parent;
|
|
@@ -56,7 +56,7 @@ function getParentModel(model) {
|
|
|
56
56
|
}
|
|
57
57
|
__RΦ.m("rt:p", [{ n: "model", t: () => __RΦ.a(505), v: null }])(getParentModel);
|
|
58
58
|
__RΦ.m("rt:f", "F")(getParentModel);
|
|
59
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
59
|
+
__RΦ.m("rt:t", () => __RΦ.a(1837))(getParentModel);
|
|
60
60
|
class XMLModel {
|
|
61
61
|
constructor(type, options) {
|
|
62
62
|
this.type = type;
|
|
@@ -67,7 +67,7 @@ class XMLModel {
|
|
|
67
67
|
if (typeof parent === "undefined")
|
|
68
68
|
parent = getParentModel(this);
|
|
69
69
|
return parent;
|
|
70
|
-
}, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(
|
|
70
|
+
}, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1837))], "getParent");
|
|
71
71
|
let propertiesLoaded = false;
|
|
72
72
|
const properties = {
|
|
73
73
|
options: new Map(),
|
|
@@ -129,7 +129,7 @@ class XMLModel {
|
|
|
129
129
|
},
|
|
130
130
|
};
|
|
131
131
|
const loadProperties = __RΦ.f(() => {
|
|
132
|
-
const props =
|
|
132
|
+
const props = this.reflectedClass.ownProperties.filter(__RΦ.f((prop) => typeof prop.host.constructor.prototype[prop.name] !== "function", [__RΦ.m("rt:p", [{ n: "prop", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(20))], "")); // filter out methods like String.prototype.concat etc... that are seen as properties
|
|
133
133
|
props.forEach(__RΦ.f((property) => {
|
|
134
134
|
const options = (0, property_1.getPropertyConversionOptions)(this.type, property.name);
|
|
135
135
|
if (!options.ignored) {
|
|
@@ -218,22 +218,23 @@ class XMLModel {
|
|
|
218
218
|
return (0, typescript_rtti_1.reflect)(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(532)], r: void 0, tp: [] });
|
|
219
219
|
}
|
|
220
220
|
resolveAllProperties() {
|
|
221
|
-
const
|
|
221
|
+
const ownProperties = new Map();
|
|
222
222
|
const parent = getParentModel(this);
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
223
|
+
this.options.properties.options.forEach(__RΦ.f((options, key) => {
|
|
224
|
+
ownProperties.set(key, new Proxy(options, {
|
|
225
|
+
get: __RΦ.f((target, p, reciever) => {
|
|
226
|
+
if (p === "model")
|
|
227
|
+
return this;
|
|
228
|
+
else
|
|
229
|
+
return Reflect.get(target, p, reciever);
|
|
230
|
+
}, [__RΦ.m("rt:p", [{ n: "target", t: () => __RΦ.a(4), v: null }, { n: "p", t: () => __RΦ.a(4), v: null }, { n: "reciever", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1))], "get"),
|
|
231
|
+
}) // FIXME: is typing ok ?
|
|
232
|
+
);
|
|
233
|
+
}, [__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(4), v: null }, { n: "key", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
|
|
234
|
+
const res = parent
|
|
235
|
+
? (0, merge_maps_1.default)(parent.resolveAllProperties(), ownProperties)
|
|
236
|
+
: ownProperties;
|
|
237
|
+
return res;
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
240
|
exports.XMLModel = XMLModel;
|
|
@@ -242,19 +243,19 @@ __RΦ.m("rt:SP", [])(XMLModel);
|
|
|
242
243
|
__RΦ.m("rt:P", ["options", "type", "reflectedClass"])(XMLModel);
|
|
243
244
|
__RΦ.m("rt:Sm", [])(XMLModel);
|
|
244
245
|
__RΦ.m("rt:m", ["fromXML", "toXML", "resolveAllProperties"])(XMLModel);
|
|
245
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(
|
|
246
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1846), v: null }])(XMLModel);
|
|
246
247
|
__RΦ.m("rt:f", "Ce")(XMLModel);
|
|
247
248
|
__RΦ.m("rt:t", () => __RΦ.a(525))(XMLModel.prototype, "options");
|
|
248
249
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "options");
|
|
249
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
250
|
+
__RΦ.m("rt:t", () => __RΦ.a(1870))(XMLModel.prototype, "parent");
|
|
250
251
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
251
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
252
|
+
__RΦ.m("rt:t", () => __RΦ.a(1880))(XMLModel.prototype, "parent");
|
|
252
253
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
253
254
|
__RΦ.m("rt:t", () => __RΦ.a(661))(XMLModel.prototype, "properties");
|
|
254
255
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
|
|
255
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
256
|
+
__RΦ.m("rt:t", () => __RΦ.a(1896))(XMLModel.prototype, "parent");
|
|
256
257
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
257
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
258
|
+
__RΦ.m("rt:t", () => __RΦ.a(1901))(XMLModel.prototype, "parent");
|
|
258
259
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
259
260
|
__RΦ.m("rt:t", () => __RΦ.a(13))(XMLModel.prototype, "tagname");
|
|
260
261
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "tagname");
|
|
@@ -278,7 +279,7 @@ __RΦ.m("rt:f", "M.")(XMLModel.prototype["resolveAllProperties"]);
|
|
|
278
279
|
((t, p) => __RΦ.m("rt:h", () => typeof t === "object" ? t.constructor : t)(t[p]))(XMLModel.prototype, "resolveAllProperties");
|
|
279
280
|
__RΦ.m("rt:p", [])(XMLModel.prototype, "resolveAllProperties");
|
|
280
281
|
__RΦ.m("rt:f", "M.")(XMLModel.prototype, "resolveAllProperties");
|
|
281
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
282
|
+
__RΦ.m("rt:t", () => __RΦ.a(1062))(XMLModel.prototype, "resolveAllProperties");
|
|
282
283
|
function createModel(type, options) {
|
|
283
284
|
if (findModel(type)) {
|
|
284
285
|
throw new TypeError(`a model for type ${type.name} already exists`);
|
|
@@ -288,17 +289,17 @@ function createModel(type, options) {
|
|
|
288
289
|
return model;
|
|
289
290
|
}
|
|
290
291
|
exports.createModel = createModel;
|
|
291
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(
|
|
292
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1626), v: null }, { n: "options", t: () => __RΦ.a(1625), v: null }])(createModel);
|
|
292
293
|
__RΦ.m("rt:f", "F")(createModel);
|
|
293
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
294
|
+
__RΦ.m("rt:t", () => __RΦ.a(1659))(createModel);
|
|
294
295
|
exports.Models = new Map();
|
|
295
296
|
function findModel(id) {
|
|
296
297
|
return exports.Models.get(id);
|
|
297
298
|
}
|
|
298
299
|
exports.findModel = findModel;
|
|
299
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
300
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1822), v: null }])(findModel);
|
|
300
301
|
__RΦ.m("rt:f", "F")(findModel);
|
|
301
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
302
|
+
__RΦ.m("rt:t", () => __RΦ.a(1832))(findModel);
|
|
302
303
|
function getModel(id) {
|
|
303
304
|
const model = findModel(id);
|
|
304
305
|
if (model)
|
|
@@ -307,20 +308,21 @@ function getModel(id) {
|
|
|
307
308
|
throw new TypeError(`couln't find model for type ${id.name}`);
|
|
308
309
|
}
|
|
309
310
|
exports.getModel = getModel;
|
|
310
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
311
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1978), v: null }])(getModel);
|
|
311
312
|
__RΦ.m("rt:f", "F")(getModel);
|
|
312
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
313
|
+
__RΦ.m("rt:t", () => __RΦ.a(1981))(getModel);
|
|
313
314
|
// Model decorator
|
|
314
315
|
function ModelDecoratorFactory(options) {
|
|
315
316
|
return __RΦ.f(function (constructor) {
|
|
316
317
|
findModel(constructor) || createModel(constructor, options || {});
|
|
317
|
-
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
318
|
+
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1987), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
318
319
|
}
|
|
319
320
|
exports.Model = ModelDecoratorFactory;
|
|
320
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
321
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1984), v: null, f: "?" }])(ModelDecoratorFactory);
|
|
321
322
|
__RΦ.m("rt:f", "F")(ModelDecoratorFactory);
|
|
322
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
323
|
+
__RΦ.m("rt:t", () => __RΦ.a(1986))(ModelDecoratorFactory);
|
|
323
324
|
var property_2 = require("./property");
|
|
324
325
|
Object.defineProperty(exports, "Prop", { enumerable: true, get: function () { return property_2.Prop; } });
|
|
325
326
|
require("../defaults/models");
|
|
326
327
|
const errors_1 = require("../errors");
|
|
328
|
+
const merge_maps_1 = __importDefault(require("../helper/merge-maps"));
|
|
@@ -16,14 +16,17 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
16
16
|
__RΦ.t[id] = t = l;
|
|
17
17
|
}
|
|
18
18
|
return t;
|
|
19
|
-
}, t: { [205]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(197)] }) }, [202]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [197]: { LΦ: t => Object }, [201]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(198), p: [__RΦ.a(197)] }) }, [198]: { LΦ: t => require("./types").IΦCreateXMLModelPropertyOptions }, [213]: { LΦ: t => Object }, [217]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(197)] }) }, [214]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [497]: { LΦ: t => require("typescript-rtti/dist").ReflectedProperty }, [13]: { LΦ: t => String }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [20]: { LΦ: t => Boolean }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => require("../types").IΦXMLElement }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [
|
|
19
|
+
}, t: { [205]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(197)] }) }, [202]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [197]: { LΦ: t => Object }, [201]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(198), p: [__RΦ.a(197)] }) }, [198]: { LΦ: t => require("./types").IΦCreateXMLModelPropertyOptions }, [213]: { LΦ: t => Object }, [217]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(197)] }) }, [214]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [497]: { LΦ: t => require("typescript-rtti/dist").ReflectedProperty }, [13]: { LΦ: t => String }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [20]: { LΦ: t => Boolean }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => require("../types").IΦXMLElement }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1409]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1408)] }) }, [1408]: { LΦ: t => Object }, [1411]: { LΦ: t => Object }, [1412]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1408)] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [1424]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1423)] }) }, [1423]: { LΦ: t => Object }, [1426]: { LΦ: t => Object }, [1435]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1427)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1427]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1423)] }) }, [1441]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1440)] }) }, [1440]: { LΦ: t => Object }, [1443]: { LΦ: t => Object }, [1467]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1440)] }) }, [1474]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(198), p: [__RΦ.a(1473)] }) }, [1473]: { LΦ: t => Object }, [1476]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1478), v: null }], f: "" }) }, [1478]: { LΦ: t => Object } } };
|
|
20
20
|
const typescript_rtti_1 = require("typescript-rtti");
|
|
21
21
|
const defaults_1 = require("../defaults");
|
|
22
22
|
function resolvePropertyConversionOptions(options, constructor, property) {
|
|
23
23
|
const _options = {
|
|
24
24
|
name: property,
|
|
25
25
|
get reflected() {
|
|
26
|
-
|
|
26
|
+
const reflectedClass = (0, typescript_rtti_1.reflect)(constructor, { TΦ: "c", t: void 0, p: [__RΦ.a(205)], r: void 0, tp: [] });
|
|
27
|
+
return (reflectedClass.getOwnProperty(property) ||
|
|
28
|
+
reflectedClass.getProperty(property)); // patch bug in typescript-rtti
|
|
29
|
+
// TODO: remove when typescript-rtti is patched
|
|
27
30
|
},
|
|
28
31
|
get tagname() {
|
|
29
32
|
return options.tagname || defaults_1.defaults.tagnameFromProperty(this);
|
|
@@ -65,7 +68,7 @@ function storePropertyConversionOptions(constructor, property, options) {
|
|
|
65
68
|
}
|
|
66
69
|
map.set(property, options);
|
|
67
70
|
}
|
|
68
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
71
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1409), v: null }, { n: "property", t: () => __RΦ.a(1411), v: null }, { n: "options", t: () => __RΦ.a(1412), v: null }])(storePropertyConversionOptions);
|
|
69
72
|
__RΦ.m("rt:f", "F")(storePropertyConversionOptions);
|
|
70
73
|
__RΦ.m("rt:t", () => __RΦ.a(22))(storePropertyConversionOptions);
|
|
71
74
|
function findPropertyConversionOptions(constructor, property) {
|
|
@@ -74,24 +77,24 @@ function findPropertyConversionOptions(constructor, property) {
|
|
|
74
77
|
return options.get(property);
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
80
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1424), v: null }, { n: "property", t: () => __RΦ.a(1426), v: null }])(findPropertyConversionOptions);
|
|
78
81
|
__RΦ.m("rt:f", "F")(findPropertyConversionOptions);
|
|
79
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
82
|
+
__RΦ.m("rt:t", () => __RΦ.a(1435))(findPropertyConversionOptions);
|
|
80
83
|
function getPropertyConversionOptions(constructor, property) {
|
|
81
84
|
const options = findPropertyConversionOptions(constructor, property);
|
|
82
85
|
return options || resolvePropertyConversionOptions({}, constructor, property);
|
|
83
86
|
}
|
|
84
87
|
exports.getPropertyConversionOptions = getPropertyConversionOptions;
|
|
85
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
88
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1441), v: null }, { n: "property", t: () => __RΦ.a(1443), v: null }])(getPropertyConversionOptions);
|
|
86
89
|
__RΦ.m("rt:f", "F")(getPropertyConversionOptions);
|
|
87
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
90
|
+
__RΦ.m("rt:t", () => __RΦ.a(1467))(getPropertyConversionOptions);
|
|
88
91
|
function PropDecoratorFactory(options) {
|
|
89
92
|
return __RΦ.f(function (prototype, property) {
|
|
90
93
|
const _options = resolvePropertyConversionOptions(options || {}, prototype.constructor, property);
|
|
91
94
|
storePropertyConversionOptions(prototype.constructor, property, _options);
|
|
92
|
-
}, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(
|
|
95
|
+
}, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1478), v: null }]), __RΦ.m("rt:f", "M."), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
93
96
|
}
|
|
94
97
|
exports.Prop = PropDecoratorFactory;
|
|
95
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
98
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1474), v: null, f: "?" }])(PropDecoratorFactory);
|
|
96
99
|
__RΦ.m("rt:f", "F")(PropDecoratorFactory);
|
|
97
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
100
|
+
__RΦ.m("rt:t", () => __RΦ.a(1476))(PropDecoratorFactory);
|
|
@@ -16,21 +16,21 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
16
16
|
__RΦ.t[id] = t = l;
|
|
17
17
|
}
|
|
18
18
|
return t;
|
|
19
|
-
}, t: { [
|
|
19
|
+
}, t: { [1363]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1334)] }) }, [214]: { TΦ: "5", name: "XMLModelPropertyOptions" }, [1334]: { LΦ: t => Object }, [1367]: { LΦ: t => Object }, [493]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(375)] }) }, [375]: { LΦ: t => Object }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => require("../types").IΦXMLElement }, [496]: { LΦ: t => Object }, [497]: { LΦ: t => require("typescript-rtti").ReflectedProperty }, [13]: { LΦ: t => String }, [20]: { LΦ: t => Boolean }, [505]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1)] }) }, [502]: { LΦ: t => require("../model").XMLModel }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [357]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(20), p: [{ n: "element", t: () => __RΦ.a(105), v: null }, { n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [399]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(400), p: [__RΦ.a(377), __RΦ.a(378)] }) }, [400]: { LΦ: t => Object }, [377]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(374), p: [__RΦ.a(215)] }) }, [374]: { TΦ: "5", name: "PropertyFromXMLContext" }, [215]: { LΦ: t => Object }, [378]: { LΦ: t => "elements" }, [1214]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(107), p: [{ n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [1216]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(1329), p: [{ n: "context", t: () => __RΦ.a(377), v: null }], f: "" }) }, [1329]: { LΦ: t => Object }, [1218]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(111), p: [{ n: "context", t: () => __RΦ.a(1336), v: null }], f: "" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1336]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1333), p: [__RΦ.a(215)] }) }, [1333]: { TΦ: "5", name: "PropertyToXMLContext" }, [1379]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(74), __RΦ.a(1378)] }) }, [74]: { LΦ: t => RegExp }, [1378]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [1270]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1339]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1292]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [506]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(505)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [610]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(602)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [602]: { TΦ: "5", name: "ConversionOptions" }, [613]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(612) }) }, [612]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [656]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(657), p: [__RΦ.a(381)] }) }, [657]: { LΦ: t => Object }, [381]: { LΦ: t => Object }, [519]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(381)] }) }, [861]: { LΦ: t => Object }, [888]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(889), p: [__RΦ.a(861)] }) }, [889]: { LΦ: t => Object }, [926]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(861)] }) }, [528]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(523)] }) }, [523]: { LΦ: t => Object }, [660]: { RΦ: t => ({ TΦ: "O", m: [{ n: "fromXML", f: "", t: __RΦ.a(667) }, { n: "toXML", f: "", t: __RΦ.a(898) }, { n: "options", f: "", t: __RΦ.a(1067) }] }) }, [667]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(663), __RΦ.a(665)] }) }, [663]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(664), p: [__RΦ.a(606), __RΦ.a(384)] }) }, [664]: { LΦ: t => Object }, [606]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(380), p: [__RΦ.a(523)] }) }, [380]: { TΦ: "5", name: "fromXMLContext" }, [384]: { LΦ: t => "properties" }, [665]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(666), p: [__RΦ.a(523)] }) }, [666]: { LΦ: t => Object }, [898]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(894), __RΦ.a(896)] }) }, [894]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(895), p: [__RΦ.a(863), __RΦ.a(384)] }) }, [895]: { LΦ: t => Object }, [863]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(523)] }) }, [860]: { TΦ: "5", name: "toXMLContext" }, [896]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(897), p: [__RΦ.a(523)] }) }, [897]: { LΦ: t => Object }, [1067]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(1065), __RΦ.a(1066)] }) }, [1055]: { LΦ: t => Map }, [1065]: { LΦ: t => Object }, [1066]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(523)] }) }, [607]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(606), __RΦ.a(523)] }) }, [864]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(863), __RΦ.a(111)] }) }, [1912]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1911)] }) }, [1911]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1623)] }) }, [1623]: { LΦ: t => Object }, [1644]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1634]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) } } };
|
|
20
20
|
var IΦPropertyToXMLContext = { name: "PropertyToXMLContext", prototype: {}, identity: Symbol("PropertyToXMLContext (interface)") };
|
|
21
21
|
exports.IΦPropertyToXMLContext = IΦPropertyToXMLContext;
|
|
22
|
-
(t => __RΦ.t[
|
|
22
|
+
(t => __RΦ.t[1333] = t)(IΦPropertyToXMLContext);
|
|
23
23
|
__RΦ.m("rt:P", ["property", "value"])(IΦPropertyToXMLContext);
|
|
24
24
|
__RΦ.m("rt:m", [])(IΦPropertyToXMLContext);
|
|
25
25
|
__RΦ.m("rt:i", [() => IΦOmit])(IΦPropertyToXMLContext);
|
|
26
26
|
__RΦ.m("rt:f", "Ie")(IΦPropertyToXMLContext);
|
|
27
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
27
|
+
__RΦ.m("rt:t", () => __RΦ.a(1363))(IΦPropertyToXMLContext.prototype, "property");
|
|
28
28
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "property");
|
|
29
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
29
|
+
__RΦ.m("rt:t", () => __RΦ.a(1367))(IΦPropertyToXMLContext.prototype, "value");
|
|
30
30
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "value");
|
|
31
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
31
|
+
__RΦ.m("rt:t", () => __RΦ.a(1363))(IΦPropertyToXMLContext.prototype, "property");
|
|
32
32
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "property");
|
|
33
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
33
|
+
__RΦ.m("rt:t", () => __RΦ.a(1367))(IΦPropertyToXMLContext.prototype, "value");
|
|
34
34
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "value");
|
|
35
35
|
var IΦPropertyFromXMLContext = { name: "PropertyFromXMLContext", prototype: {}, identity: Symbol("PropertyFromXMLContext (interface)") };
|
|
36
36
|
exports.IΦPropertyFromXMLContext = IΦPropertyFromXMLContext;
|
|
@@ -67,11 +67,11 @@ __RΦ.m("rt:t", () => __RΦ.a(505))(IΦXMLModelPropertyOptions.prototype, "model
|
|
|
67
67
|
__RΦ.m("rt:f", "P?")(IΦXMLModelPropertyOptions.prototype, "model");
|
|
68
68
|
__RΦ.m("rt:t", () => __RΦ.a(357))(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
69
69
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
70
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
70
|
+
__RΦ.m("rt:t", () => __RΦ.a(1214))(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
71
71
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
72
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
72
|
+
__RΦ.m("rt:t", () => __RΦ.a(1216))(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
73
73
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
74
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
74
|
+
__RΦ.m("rt:t", () => __RΦ.a(1218))(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
75
75
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
76
76
|
__RΦ.m("rt:t", () => __RΦ.a(496))(IΦXMLModelPropertyOptions.prototype, "name");
|
|
77
77
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "name");
|
|
@@ -87,11 +87,11 @@ __RΦ.m("rt:t", () => __RΦ.a(505))(IΦXMLModelPropertyOptions.prototype, "model
|
|
|
87
87
|
__RΦ.m("rt:f", "P?")(IΦXMLModelPropertyOptions.prototype, "model");
|
|
88
88
|
__RΦ.m("rt:t", () => __RΦ.a(357))(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
89
89
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
90
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
90
|
+
__RΦ.m("rt:t", () => __RΦ.a(1214))(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
91
91
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
92
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
92
|
+
__RΦ.m("rt:t", () => __RΦ.a(1216))(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
93
93
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
94
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
94
|
+
__RΦ.m("rt:t", () => __RΦ.a(1218))(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
95
95
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
96
96
|
var IΦCreateXMLModelPropertyOptions = { name: "CreateXMLModelPropertyOptions", prototype: {}, identity: Symbol("CreateXMLModelPropertyOptions (interface)") };
|
|
97
97
|
exports.IΦCreateXMLModelPropertyOptions = IΦCreateXMLModelPropertyOptions;
|
|
@@ -101,13 +101,13 @@ __RΦ.m("rt:m", [])(IΦCreateXMLModelPropertyOptions);
|
|
|
101
101
|
__RΦ.m("rt:f", "Ie")(IΦCreateXMLModelPropertyOptions);
|
|
102
102
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
103
103
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
104
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
104
|
+
__RΦ.m("rt:t", () => __RΦ.a(1379))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
105
105
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
106
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
106
|
+
__RΦ.m("rt:t", () => __RΦ.a(1270))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
107
107
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
108
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
108
|
+
__RΦ.m("rt:t", () => __RΦ.a(1339))(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
109
109
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
110
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
110
|
+
__RΦ.m("rt:t", () => __RΦ.a(1292))(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
111
111
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
112
112
|
__RΦ.m("rt:t", () => __RΦ.a(20))(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
113
113
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
@@ -117,13 +117,13 @@ __RΦ.m("rt:t", () => __RΦ.a(506))(IΦCreateXMLModelPropertyOptions.prototype,
|
|
|
117
117
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "model");
|
|
118
118
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
119
119
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
120
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
120
|
+
__RΦ.m("rt:t", () => __RΦ.a(1379))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
121
121
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
122
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
122
|
+
__RΦ.m("rt:t", () => __RΦ.a(1270))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
123
123
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
124
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
124
|
+
__RΦ.m("rt:t", () => __RΦ.a(1339))(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
125
125
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
126
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
126
|
+
__RΦ.m("rt:t", () => __RΦ.a(1292))(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
127
127
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
128
128
|
__RΦ.m("rt:t", () => __RΦ.a(20))(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
129
129
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
@@ -208,23 +208,23 @@ __RΦ.m("rt:t", () => __RΦ.a(13))(IΦXMLModelOptions.prototype, "tagname");
|
|
|
208
208
|
__RΦ.m("rt:f", "P")(IΦXMLModelOptions.prototype, "tagname");
|
|
209
209
|
var IΦCreateXMLModelOptions = { name: "CreateXMLModelOptions", prototype: {}, identity: Symbol("CreateXMLModelOptions (interface)") };
|
|
210
210
|
exports.IΦCreateXMLModelOptions = IΦCreateXMLModelOptions;
|
|
211
|
-
(t => __RΦ.t[
|
|
211
|
+
(t => __RΦ.t[1622] = t)(IΦCreateXMLModelOptions);
|
|
212
212
|
__RΦ.m("rt:P", ["parent", "fromXML", "toXML", "tagname"])(IΦCreateXMLModelOptions);
|
|
213
213
|
__RΦ.m("rt:m", [])(IΦCreateXMLModelOptions);
|
|
214
214
|
__RΦ.m("rt:f", "Ie")(IΦCreateXMLModelOptions);
|
|
215
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
215
|
+
__RΦ.m("rt:t", () => __RΦ.a(1912))(IΦCreateXMLModelOptions.prototype, "parent");
|
|
216
216
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "parent");
|
|
217
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
217
|
+
__RΦ.m("rt:t", () => __RΦ.a(1644))(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
218
218
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
219
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
219
|
+
__RΦ.m("rt:t", () => __RΦ.a(1634))(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
220
220
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
221
221
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelOptions.prototype, "tagname");
|
|
222
222
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "tagname");
|
|
223
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
223
|
+
__RΦ.m("rt:t", () => __RΦ.a(1912))(IΦCreateXMLModelOptions.prototype, "parent");
|
|
224
224
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "parent");
|
|
225
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
225
|
+
__RΦ.m("rt:t", () => __RΦ.a(1644))(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
226
226
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
227
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
227
|
+
__RΦ.m("rt:t", () => __RΦ.a(1634))(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
228
228
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
229
229
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelOptions.prototype, "tagname");
|
|
230
230
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "tagname");
|
package/build/main/model.spec.js
CHANGED
|
@@ -24,7 +24,7 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
24
24
|
__RΦ.t[id] = t = l;
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
|
-
}, t: { [
|
|
27
|
+
}, t: { [2761]: { RΦ: t => ({ TΦ: "O", m: [{ n: "propA", f: "", t: __RΦ.a(13) }, { n: "propB", f: "", t: __RΦ.a(20) }, { n: "propC", f: "", t: __RΦ.a(2777) }, { n: "propD", f: "", t: __RΦ.a(705) }, { n: "__constructor", f: "", t: __RΦ.a(4) }] }) }, [13]: { LΦ: t => String }, [20]: { LΦ: t => Boolean }, [2777]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2775) }) }, [2775]: { TΦ: "5", name: "B" }, [705]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(47), __RΦ.a(135)] }) }, [47]: { LΦ: t => 0 }, [135]: { LΦ: t => 1 }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [2713]: { RΦ: t => ({ TΦ: "O", m: [{ n: "name", f: "", t: __RΦ.a(13) }, { n: "nbPages", f: "", t: __RΦ.a(14) }] }) }, [14]: { LΦ: t => Number }, [2732]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2676) }) }, [2676]: { TΦ: "5", name: "Book" }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [101]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(102), p: [] }) }, [102]: { LΦ: t => Object } } };
|
|
28
28
|
require("mocha");
|
|
29
29
|
const chai_1 = require("chai");
|
|
30
30
|
require("reflect-metadata");
|
|
@@ -44,12 +44,12 @@ Book = __decorate([
|
|
|
44
44
|
},
|
|
45
45
|
})
|
|
46
46
|
], Book);
|
|
47
|
-
(t => __RΦ.t[
|
|
47
|
+
(t => __RΦ.t[2676] = t)(Book);
|
|
48
48
|
__RΦ.m("rt:SP", [])(Book);
|
|
49
49
|
__RΦ.m("rt:P", ["name", "nbPages"])(Book);
|
|
50
50
|
__RΦ.m("rt:Sm", [])(Book);
|
|
51
51
|
__RΦ.m("rt:m", ["fromXML"])(Book);
|
|
52
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
52
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(2713), v: null }])(Book);
|
|
53
53
|
__RΦ.m("rt:f", "C")(Book);
|
|
54
54
|
__RΦ.m("rt:t", () => __RΦ.a(13))(Book.prototype, "name");
|
|
55
55
|
__RΦ.m("rt:f", "P")(Book.prototype, "name");
|
|
@@ -69,16 +69,16 @@ Library = __decorate([
|
|
|
69
69
|
},
|
|
70
70
|
})
|
|
71
71
|
], Library);
|
|
72
|
-
(t => __RΦ.t[
|
|
72
|
+
(t => __RΦ.t[2716] = t)(Library);
|
|
73
73
|
__RΦ.m("rt:SP", [])(Library);
|
|
74
74
|
__RΦ.m("rt:P", ["name", "books"])(Library);
|
|
75
75
|
__RΦ.m("rt:Sm", [])(Library);
|
|
76
76
|
__RΦ.m("rt:m", ["fromXML"])(Library);
|
|
77
|
-
__RΦ.m("rt:p", [{ n: "name", t: () => __RΦ.a(13), v: null }, { n: "books", t: () => __RΦ.a(
|
|
77
|
+
__RΦ.m("rt:p", [{ n: "name", t: () => __RΦ.a(13), v: null }, { n: "books", t: () => __RΦ.a(2732), v: null, f: "3" }])(Library);
|
|
78
78
|
__RΦ.m("rt:f", "C")(Library);
|
|
79
79
|
__RΦ.m("rt:t", () => __RΦ.a(13))(Library.prototype, "name");
|
|
80
80
|
__RΦ.m("rt:f", "P")(Library.prototype, "name");
|
|
81
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
81
|
+
__RΦ.m("rt:t", () => __RΦ.a(2732))(Library.prototype, "books");
|
|
82
82
|
__RΦ.m("rt:f", "P")(Library.prototype, "books");
|
|
83
83
|
describe("Library Example", __RΦ.f(() => {
|
|
84
84
|
const library = new Library("test");
|
|
@@ -132,7 +132,7 @@ A = __decorate([
|
|
|
132
132
|
},
|
|
133
133
|
})
|
|
134
134
|
], A);
|
|
135
|
-
(t => __RΦ.t[
|
|
135
|
+
(t => __RΦ.t[2762] = t)(A);
|
|
136
136
|
__RΦ.m("rt:SP", [])(A);
|
|
137
137
|
__RΦ.m("rt:P", ["propA", "propB", "propC", "propD"])(A);
|
|
138
138
|
__RΦ.m("rt:Sm", [])(A);
|
|
@@ -143,7 +143,7 @@ __RΦ.m("rt:t", () => __RΦ.a(13))(A.prototype, "propA");
|
|
|
143
143
|
__RΦ.m("rt:f", "P")(A.prototype, "propA");
|
|
144
144
|
__RΦ.m("rt:t", () => __RΦ.a(20))(A.prototype, "propB");
|
|
145
145
|
__RΦ.m("rt:f", "P")(A.prototype, "propB");
|
|
146
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
146
|
+
__RΦ.m("rt:t", () => __RΦ.a(2777))(A.prototype, "propC");
|
|
147
147
|
__RΦ.m("rt:f", "P")(A.prototype, "propC");
|
|
148
148
|
__RΦ.m("rt:t", () => __RΦ.a(705))(A.prototype, "propD");
|
|
149
149
|
__RΦ.m("rt:f", "P")(A.prototype, "propD");
|
|
@@ -163,7 +163,7 @@ B = __decorate([
|
|
|
163
163
|
},
|
|
164
164
|
})
|
|
165
165
|
], B);
|
|
166
|
-
(t => __RΦ.t[
|
|
166
|
+
(t => __RΦ.t[2775] = t)(B);
|
|
167
167
|
__RΦ.m("rt:SP", [])(B);
|
|
168
168
|
__RΦ.m("rt:P", ["propA"])(B);
|
|
169
169
|
__RΦ.m("rt:Sm", [])(B);
|
|
@@ -186,8 +186,8 @@ describe("Edgy Cases", __RΦ.f(() => {
|
|
|
186
186
|
<propd>${instance.propD}</propd>
|
|
187
187
|
</a>`));
|
|
188
188
|
it("should give right type infos", __RΦ.f(() => {
|
|
189
|
-
const reflectedA = (0, typescript_rtti_1.reflect)(A, { TΦ: "c", t: void 0, p: [__RΦ.a(
|
|
190
|
-
(0, chai_1.assert)(reflectedA === (0, typescript_rtti_1.reflect)(A, { TΦ: "c", t: void 0, p: [__RΦ.a(
|
|
189
|
+
const reflectedA = (0, typescript_rtti_1.reflect)(A, { TΦ: "c", t: void 0, p: [__RΦ.a(2761)], r: void 0, tp: [] });
|
|
190
|
+
(0, chai_1.assert)(reflectedA === (0, typescript_rtti_1.reflect)(A, { TΦ: "c", t: void 0, p: [__RΦ.a(2761)], r: void 0, tp: [] }));
|
|
191
191
|
(0, chai_1.expect)(reflectedA.getProperty("propA").type.isClass(String)).to.be.true;
|
|
192
192
|
(0, chai_1.expect)(reflectedA.getProperty("propB").type.isClass(Boolean)).to.be.true;
|
|
193
193
|
const ModelAPropCType = reflectedA.getProperty("propC").type;
|
|
@@ -214,7 +214,7 @@ let C = class C extends B {
|
|
|
214
214
|
C = __decorate([
|
|
215
215
|
(0, model_1.Model)()
|
|
216
216
|
], C);
|
|
217
|
-
(t => __RΦ.t[
|
|
217
|
+
(t => __RΦ.t[2820] = t)(C);
|
|
218
218
|
__RΦ.m("rt:SP", [])(C);
|
|
219
219
|
__RΦ.m("rt:P", ["propB"])(C);
|
|
220
220
|
__RΦ.m("rt:Sm", [])(C);
|
|
@@ -13,7 +13,7 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
13
13
|
__RΦ.t[id] = t = l;
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
|
-
}, t: { [4]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => LΦ_0.IΦXMLElement }, [13]: { LΦ: t => String }, [14]: { LΦ: t => Number }, [
|
|
16
|
+
}, t: { [4]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => LΦ_0.IΦXMLElement }, [13]: { LΦ: t => String }, [14]: { LΦ: t => Number }, [1698]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(3179) }] }) }, [3179]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(3177) }) }, [3177]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(13) }, { n: "name", f: "", t: __RΦ.a(13) }] }) }, [20]: { LΦ: t => Boolean } } };
|
|
17
17
|
import { createModel } from "../model";
|
|
18
18
|
import { getContent, fromContent } from "../xml";
|
|
19
19
|
import * as LΦ_0 from "../types";
|
|
@@ -47,7 +47,7 @@ createModel(Boolean, {
|
|
|
47
47
|
Object.assign({ type: "element", name: "boolean" }, fromContent(String(ctx.object))),
|
|
48
48
|
],
|
|
49
49
|
};
|
|
50
|
-
}, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(
|
|
50
|
+
}, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1698))], "toXML"),
|
|
51
51
|
fromXML: __RΦ.f((ctx) => {
|
|
52
52
|
return Boolean(getContent(ctx.xml.elements[0]));
|
|
53
53
|
}, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(20))], "fromXML"),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function mergeMaps<K, V>(...sources: Map<K, V>[]): Map<K, V>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metadata(k, v)(t, ...a) : void 0, f: (f, d, n) => (d.forEach(d => d(f)), Object.defineProperty(f, "name", { value: n, writable: false }), f), c: (c, d, dp, dsp, n) => (d.forEach(d => d(c)), dp.forEach(([p, d]) => d(c.prototype, p)), dsp.forEach(([p, d]) => d(c, p)), n ? Object.defineProperty(c, "name", { value: n, writable: false }) : undefined, c), r: (o, a) => (Object.assign(o, a)), a: id => {
|
|
2
|
+
let t = __RΦ.t[id];
|
|
3
|
+
if (t === void 0)
|
|
4
|
+
return void 0;
|
|
5
|
+
if (t.RΦ) {
|
|
6
|
+
let r = t.RΦ;
|
|
7
|
+
delete t.RΦ;
|
|
8
|
+
__RΦ.r(t, r(t));
|
|
9
|
+
}
|
|
10
|
+
else if (t.LΦ) {
|
|
11
|
+
let l = t.LΦ();
|
|
12
|
+
delete t.LΦ;
|
|
13
|
+
__RΦ.t[id] = t = l;
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
}, t: { [1719]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(1718) }) }, [1718]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(1716), __RΦ.a(1717)] }) }, [1055]: { LΦ: t => Map }, [1716]: { LΦ: t => Object }, [1717]: { LΦ: t => Object }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [22]: { RΦ: t => ({ TΦ: "V" }) } } };
|
|
17
|
+
export default function mergeMaps(...sources) {
|
|
18
|
+
const res = new Map();
|
|
19
|
+
sources.forEach(__RΦ.f((source) => {
|
|
20
|
+
const overrides = new Map();
|
|
21
|
+
const additions = new Map();
|
|
22
|
+
source.forEach(__RΦ.f((val, key) => (res.has(key) ? overrides : additions).set(key, val), [__RΦ.m("rt:p", [{ n: "val", t: () => __RΦ.a(4), v: null }, { n: "key", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1718))], ""));
|
|
23
|
+
if (overrides.size) {
|
|
24
|
+
const entries = Array.from(res.entries());
|
|
25
|
+
entries.forEach(__RΦ.f((entry) => {
|
|
26
|
+
const key = entry[0];
|
|
27
|
+
if (overrides.has(key))
|
|
28
|
+
entry[1] = overrides.get(key);
|
|
29
|
+
}, [__RΦ.m("rt:p", [{ n: "entry", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
|
|
30
|
+
res.clear();
|
|
31
|
+
entries.forEach(__RΦ.f(([key, val]) => res.set(key, val), [__RΦ.m("rt:p", [{ n: "[key, val]", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1718))], ""));
|
|
32
|
+
}
|
|
33
|
+
additions.forEach(__RΦ.f((val, key) => res.set(key, val), [__RΦ.m("rt:p", [{ n: "val", t: () => __RΦ.a(4), v: null }, { n: "key", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1718))], ""));
|
|
34
|
+
}, [__RΦ.m("rt:p", [{ n: "source", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
|
|
35
|
+
return res;
|
|
36
|
+
}
|
|
37
|
+
__RΦ.m("rt:p", [{ n: "sources", t: () => __RΦ.a(1719), v: null, f: "3" }])(mergeMaps);
|
|
38
|
+
__RΦ.m("rt:f", "F")(mergeMaps);
|
|
39
|
+
__RΦ.m("rt:t", () => __RΦ.a(1718))(mergeMaps);
|
|
@@ -13,7 +13,7 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
13
13
|
__RΦ.t[id] = t = l;
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
|
-
}, t: { [532]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(503)] }) }, [202]: { LΦ: t => LΦ_0.IΦConstructor }, [503]: { LΦ: t => Object }, [
|
|
16
|
+
}, t: { [532]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(503)] }) }, [202]: { LΦ: t => LΦ_0.IΦConstructor }, [503]: { LΦ: t => Object }, [1814]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1817]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1814), __RΦ.a(22), __RΦ.a(8)] }) }, [140]: { LΦ: t => Object }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [505]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1)] }) }, [502]: { TΦ: "5", name: "XMLModel" }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [1837]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1846]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(503)] }) }, [1622]: { LΦ: t => LΦ_1.IΦCreateXMLModelOptions }, [525]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(522), p: [__RΦ.a(503)] }) }, [522]: { LΦ: t => LΦ_1.IΦXMLModelOptions }, [1870]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1321)] }) }, [1321]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(422), __RΦ.a(1319)] }) }, [602]: { LΦ: t => LΦ_1.IΦConversionOptions }, [422]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(423), p: [__RΦ.a(421), __RΦ.a(384)] }) }, [423]: { LΦ: t => Object }, [421]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(380), p: [__RΦ.a(1)] }) }, [380]: { LΦ: t => LΦ_1.IΦfromXMLContext }, [384]: { LΦ: t => "properties" }, [1319]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1320), p: [__RΦ.a(1)] }) }, [1320]: { LΦ: t => Object }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [658]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(659), p: [__RΦ.a(503)] }) }, [659]: { LΦ: t => Object }, [1880]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1878)] }) }, [1878]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1353), __RΦ.a(1876)] }) }, [1353]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1354), p: [__RΦ.a(1352), __RΦ.a(384)] }) }, [1354]: { LΦ: t => Object }, [1352]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(1)] }) }, [860]: { LΦ: t => LΦ_1.IΦtoXMLContext }, [1876]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1877), p: [__RΦ.a(1)] }) }, [1877]: { LΦ: t => Object }, [890]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(891), p: [__RΦ.a(503)] }) }, [891]: { LΦ: t => Object }, [20]: { LΦ: t => Boolean }, [661]: { RΦ: t => ({ TΦ: "O", m: [{ n: "fromXML", f: "", t: __RΦ.a(667) }, { n: "toXML", f: "", t: __RΦ.a(898) }, { n: "options", f: "", t: __RΦ.a(1067) }] }) }, [667]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(663), __RΦ.a(665)] }) }, [663]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(664), p: [__RΦ.a(606), __RΦ.a(384)] }) }, [664]: { LΦ: t => Object }, [606]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(380), p: [__RΦ.a(523)] }) }, [523]: { LΦ: t => Object }, [665]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(666), p: [__RΦ.a(523)] }) }, [666]: { LΦ: t => Object }, [898]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(894), __RΦ.a(896)] }) }, [894]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(895), p: [__RΦ.a(863), __RΦ.a(384)] }) }, [895]: { LΦ: t => Object }, [863]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(523)] }) }, [896]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(897), p: [__RΦ.a(523)] }) }, [897]: { LΦ: t => Object }, [1067]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(1065), __RΦ.a(1066)] }) }, [1055]: { LΦ: t => Map }, [1065]: { LΦ: t => Object }, [1066]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(523)] }) }, [214]: { LΦ: t => LΦ_1.IΦXMLModelPropertyOptions }, [1896]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1894)] }) }, [1894]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1901]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1899)] }) }, [1899]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1352), __RΦ.a(111)] }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => LΦ_2.IΦXMLElement }, [13]: { LΦ: t => String }, [541]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(111)] }) }, [28]: { LΦ: t => Object }, [948]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(944), p: [__RΦ.a(532)] }) }, [944]: { LΦ: t => LΦ_0.ReflectedClass }, [1062]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(13), __RΦ.a(1061)] }) }, [1061]: { RΦ: t => ({ TΦ: "&", t: [__RΦ.a(1059), __RΦ.a(1060)] }) }, [1059]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1)] }) }, [1060]: { RΦ: t => ({ TΦ: "O", m: [{ n: "model", f: "", t: __RΦ.a(1) }] }) }, [1626]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1621)] }) }, [1621]: { LΦ: t => Object }, [1625]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(1621)] }) }, [1659]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1621)] }) }, [1822]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1819)] }) }, [1819]: { LΦ: t => Object }, [1832]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1831)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1831]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1819)] }) }, [1978]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1977)] }) }, [1977]: { LΦ: t => Object }, [1981]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1977)] }) }, [1984]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(1983)] }) }, [1983]: { LΦ: t => Object }, [1986]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1987), v: null }], f: "" }) }, [1987]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1983)] }) } } };
|
|
17
17
|
import { reflect } from "typescript-rtti";
|
|
18
18
|
import { MiddlewareChain, resolve } from "../middleware";
|
|
19
19
|
import { getPropertyConversionOptions } from "./property";
|
|
@@ -34,9 +34,9 @@ function* ParentChain(constructor) {
|
|
|
34
34
|
}
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
37
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1814), v: null }])(ParentChain);
|
|
38
38
|
__RΦ.m("rt:f", "F")(ParentChain);
|
|
39
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
39
|
+
__RΦ.m("rt:t", () => __RΦ.a(1817))(ParentChain);
|
|
40
40
|
import * as LΦ_1 from "./types";
|
|
41
41
|
import * as LΦ_2 from "../types";
|
|
42
42
|
function getParentModel(model) {
|
|
@@ -52,7 +52,7 @@ function getParentModel(model) {
|
|
|
52
52
|
}
|
|
53
53
|
__RΦ.m("rt:p", [{ n: "model", t: () => __RΦ.a(505), v: null }])(getParentModel);
|
|
54
54
|
__RΦ.m("rt:f", "F")(getParentModel);
|
|
55
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
55
|
+
__RΦ.m("rt:t", () => __RΦ.a(1837))(getParentModel);
|
|
56
56
|
import * as LΦ_0 from "typescript-rtti/dist";
|
|
57
57
|
export class XMLModel {
|
|
58
58
|
constructor(type, options) {
|
|
@@ -64,7 +64,7 @@ export class XMLModel {
|
|
|
64
64
|
if (typeof parent === "undefined")
|
|
65
65
|
parent = getParentModel(this);
|
|
66
66
|
return parent;
|
|
67
|
-
}, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(
|
|
67
|
+
}, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1837))], "getParent");
|
|
68
68
|
let propertiesLoaded = false;
|
|
69
69
|
const properties = {
|
|
70
70
|
options: new Map(),
|
|
@@ -126,7 +126,7 @@ export class XMLModel {
|
|
|
126
126
|
},
|
|
127
127
|
};
|
|
128
128
|
const loadProperties = __RΦ.f(() => {
|
|
129
|
-
const props =
|
|
129
|
+
const props = this.reflectedClass.ownProperties.filter(__RΦ.f((prop) => typeof prop.host.constructor.prototype[prop.name] !== "function", [__RΦ.m("rt:p", [{ n: "prop", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(20))], "")); // filter out methods like String.prototype.concat etc... that are seen as properties
|
|
130
130
|
props.forEach(__RΦ.f((property) => {
|
|
131
131
|
const options = getPropertyConversionOptions(this.type, property.name);
|
|
132
132
|
if (!options.ignored) {
|
|
@@ -215,22 +215,23 @@ export class XMLModel {
|
|
|
215
215
|
return reflect(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(532)], r: void 0, tp: [] });
|
|
216
216
|
}
|
|
217
217
|
resolveAllProperties() {
|
|
218
|
-
const
|
|
218
|
+
const ownProperties = new Map();
|
|
219
219
|
const parent = getParentModel(this);
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
220
|
+
this.options.properties.options.forEach(__RΦ.f((options, key) => {
|
|
221
|
+
ownProperties.set(key, new Proxy(options, {
|
|
222
|
+
get: __RΦ.f((target, p, reciever) => {
|
|
223
|
+
if (p === "model")
|
|
224
|
+
return this;
|
|
225
|
+
else
|
|
226
|
+
return Reflect.get(target, p, reciever);
|
|
227
|
+
}, [__RΦ.m("rt:p", [{ n: "target", t: () => __RΦ.a(4), v: null }, { n: "p", t: () => __RΦ.a(4), v: null }, { n: "reciever", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1))], "get"),
|
|
228
|
+
}) // FIXME: is typing ok ?
|
|
229
|
+
);
|
|
230
|
+
}, [__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(4), v: null }, { n: "key", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
|
|
231
|
+
const res = parent
|
|
232
|
+
? mergeMaps(parent.resolveAllProperties(), ownProperties)
|
|
233
|
+
: ownProperties;
|
|
234
|
+
return res;
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
(t => __RΦ.t[502] = t)(XMLModel);
|
|
@@ -238,19 +239,19 @@ __RΦ.m("rt:SP", [])(XMLModel);
|
|
|
238
239
|
__RΦ.m("rt:P", ["options", "type", "reflectedClass"])(XMLModel);
|
|
239
240
|
__RΦ.m("rt:Sm", [])(XMLModel);
|
|
240
241
|
__RΦ.m("rt:m", ["fromXML", "toXML", "resolveAllProperties"])(XMLModel);
|
|
241
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(
|
|
242
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1846), v: null }])(XMLModel);
|
|
242
243
|
__RΦ.m("rt:f", "Ce")(XMLModel);
|
|
243
244
|
__RΦ.m("rt:t", () => __RΦ.a(525))(XMLModel.prototype, "options");
|
|
244
245
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "options");
|
|
245
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
246
|
+
__RΦ.m("rt:t", () => __RΦ.a(1870))(XMLModel.prototype, "parent");
|
|
246
247
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
247
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
248
|
+
__RΦ.m("rt:t", () => __RΦ.a(1880))(XMLModel.prototype, "parent");
|
|
248
249
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
249
250
|
__RΦ.m("rt:t", () => __RΦ.a(661))(XMLModel.prototype, "properties");
|
|
250
251
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
|
|
251
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
252
|
+
__RΦ.m("rt:t", () => __RΦ.a(1896))(XMLModel.prototype, "parent");
|
|
252
253
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
253
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
254
|
+
__RΦ.m("rt:t", () => __RΦ.a(1901))(XMLModel.prototype, "parent");
|
|
254
255
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
255
256
|
__RΦ.m("rt:t", () => __RΦ.a(13))(XMLModel.prototype, "tagname");
|
|
256
257
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "tagname");
|
|
@@ -274,7 +275,7 @@ __RΦ.m("rt:f", "M.")(XMLModel.prototype["resolveAllProperties"]);
|
|
|
274
275
|
((t, p) => __RΦ.m("rt:h", () => typeof t === "object" ? t.constructor : t)(t[p]))(XMLModel.prototype, "resolveAllProperties");
|
|
275
276
|
__RΦ.m("rt:p", [])(XMLModel.prototype, "resolveAllProperties");
|
|
276
277
|
__RΦ.m("rt:f", "M.")(XMLModel.prototype, "resolveAllProperties");
|
|
277
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
278
|
+
__RΦ.m("rt:t", () => __RΦ.a(1062))(XMLModel.prototype, "resolveAllProperties");
|
|
278
279
|
export function createModel(type, options) {
|
|
279
280
|
if (findModel(type)) {
|
|
280
281
|
throw new TypeError(`a model for type ${type.name} already exists`);
|
|
@@ -283,16 +284,16 @@ export function createModel(type, options) {
|
|
|
283
284
|
Models.set(type, model);
|
|
284
285
|
return model;
|
|
285
286
|
}
|
|
286
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(
|
|
287
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1626), v: null }, { n: "options", t: () => __RΦ.a(1625), v: null }])(createModel);
|
|
287
288
|
__RΦ.m("rt:f", "F")(createModel);
|
|
288
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
289
|
+
__RΦ.m("rt:t", () => __RΦ.a(1659))(createModel);
|
|
289
290
|
export const Models = new Map();
|
|
290
291
|
export function findModel(id) {
|
|
291
292
|
return Models.get(id);
|
|
292
293
|
}
|
|
293
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
294
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1822), v: null }])(findModel);
|
|
294
295
|
__RΦ.m("rt:f", "F")(findModel);
|
|
295
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
296
|
+
__RΦ.m("rt:t", () => __RΦ.a(1832))(findModel);
|
|
296
297
|
export function getModel(id) {
|
|
297
298
|
const model = findModel(id);
|
|
298
299
|
if (model)
|
|
@@ -300,19 +301,20 @@ export function getModel(id) {
|
|
|
300
301
|
else
|
|
301
302
|
throw new TypeError(`couln't find model for type ${id.name}`);
|
|
302
303
|
}
|
|
303
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
304
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1978), v: null }])(getModel);
|
|
304
305
|
__RΦ.m("rt:f", "F")(getModel);
|
|
305
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
306
|
+
__RΦ.m("rt:t", () => __RΦ.a(1981))(getModel);
|
|
306
307
|
// Model decorator
|
|
307
308
|
function ModelDecoratorFactory(options) {
|
|
308
309
|
return __RΦ.f(function (constructor) {
|
|
309
310
|
findModel(constructor) || createModel(constructor, options || {});
|
|
310
|
-
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
311
|
+
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1987), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
311
312
|
}
|
|
312
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
313
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1984), v: null, f: "?" }])(ModelDecoratorFactory);
|
|
313
314
|
__RΦ.m("rt:f", "F")(ModelDecoratorFactory);
|
|
314
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
315
|
+
__RΦ.m("rt:t", () => __RΦ.a(1986))(ModelDecoratorFactory);
|
|
315
316
|
export { ModelDecoratorFactory as Model };
|
|
316
317
|
export { Prop } from "./property";
|
|
317
318
|
import "../defaults/models";
|
|
318
319
|
import { XMLConversionError } from "../errors";
|
|
320
|
+
import mergeMaps from "../helper/merge-maps";
|
|
@@ -13,7 +13,7 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
13
13
|
__RΦ.t[id] = t = l;
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
|
-
}, t: { [205]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(197)] }) }, [202]: { LΦ: t => LΦ_0.IΦConstructor }, [197]: { LΦ: t => Object }, [201]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(198), p: [__RΦ.a(197)] }) }, [198]: { LΦ: t => LΦ_1.IΦCreateXMLModelPropertyOptions }, [213]: { LΦ: t => Object }, [217]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(197)] }) }, [214]: { LΦ: t => LΦ_1.IΦXMLModelPropertyOptions }, [497]: { LΦ: t => LΦ_0.ReflectedProperty }, [13]: { LΦ: t => String }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [20]: { LΦ: t => Boolean }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => LΦ_2.IΦXMLElement }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [
|
|
16
|
+
}, t: { [205]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(197)] }) }, [202]: { LΦ: t => LΦ_0.IΦConstructor }, [197]: { LΦ: t => Object }, [201]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(198), p: [__RΦ.a(197)] }) }, [198]: { LΦ: t => LΦ_1.IΦCreateXMLModelPropertyOptions }, [213]: { LΦ: t => Object }, [217]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(197)] }) }, [214]: { LΦ: t => LΦ_1.IΦXMLModelPropertyOptions }, [497]: { LΦ: t => LΦ_0.ReflectedProperty }, [13]: { LΦ: t => String }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [20]: { LΦ: t => Boolean }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => LΦ_2.IΦXMLElement }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1409]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1408)] }) }, [1408]: { LΦ: t => Object }, [1411]: { LΦ: t => Object }, [1412]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1408)] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [1424]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1423)] }) }, [1423]: { LΦ: t => Object }, [1426]: { LΦ: t => Object }, [1435]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1427)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1427]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1423)] }) }, [1441]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1440)] }) }, [1440]: { LΦ: t => Object }, [1443]: { LΦ: t => Object }, [1467]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1440)] }) }, [1474]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(198), p: [__RΦ.a(1473)] }) }, [1473]: { LΦ: t => Object }, [1476]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1478), v: null }], f: "" }) }, [1478]: { LΦ: t => Object } } };
|
|
17
17
|
import { reflect } from "typescript-rtti";
|
|
18
18
|
import * as LΦ_1 from "./types";
|
|
19
19
|
import * as LΦ_2 from "../types";
|
|
@@ -23,7 +23,10 @@ function resolvePropertyConversionOptions(options, constructor, property) {
|
|
|
23
23
|
const _options = {
|
|
24
24
|
name: property,
|
|
25
25
|
get reflected() {
|
|
26
|
-
|
|
26
|
+
const reflectedClass = reflect(constructor, { TΦ: "c", t: void 0, p: [__RΦ.a(205)], r: void 0, tp: [] });
|
|
27
|
+
return (reflectedClass.getOwnProperty(property) ||
|
|
28
|
+
reflectedClass.getProperty(property)); // patch bug in typescript-rtti
|
|
29
|
+
// TODO: remove when typescript-rtti is patched
|
|
27
30
|
},
|
|
28
31
|
get tagname() {
|
|
29
32
|
return options.tagname || defaults.tagnameFromProperty(this);
|
|
@@ -65,7 +68,7 @@ function storePropertyConversionOptions(constructor, property, options) {
|
|
|
65
68
|
}
|
|
66
69
|
map.set(property, options);
|
|
67
70
|
}
|
|
68
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
71
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1409), v: null }, { n: "property", t: () => __RΦ.a(1411), v: null }, { n: "options", t: () => __RΦ.a(1412), v: null }])(storePropertyConversionOptions);
|
|
69
72
|
__RΦ.m("rt:f", "F")(storePropertyConversionOptions);
|
|
70
73
|
__RΦ.m("rt:t", () => __RΦ.a(22))(storePropertyConversionOptions);
|
|
71
74
|
function findPropertyConversionOptions(constructor, property) {
|
|
@@ -74,23 +77,23 @@ function findPropertyConversionOptions(constructor, property) {
|
|
|
74
77
|
return options.get(property);
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
80
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1424), v: null }, { n: "property", t: () => __RΦ.a(1426), v: null }])(findPropertyConversionOptions);
|
|
78
81
|
__RΦ.m("rt:f", "F")(findPropertyConversionOptions);
|
|
79
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
82
|
+
__RΦ.m("rt:t", () => __RΦ.a(1435))(findPropertyConversionOptions);
|
|
80
83
|
export function getPropertyConversionOptions(constructor, property) {
|
|
81
84
|
const options = findPropertyConversionOptions(constructor, property);
|
|
82
85
|
return options || resolvePropertyConversionOptions({}, constructor, property);
|
|
83
86
|
}
|
|
84
|
-
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
87
|
+
__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1441), v: null }, { n: "property", t: () => __RΦ.a(1443), v: null }])(getPropertyConversionOptions);
|
|
85
88
|
__RΦ.m("rt:f", "F")(getPropertyConversionOptions);
|
|
86
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
89
|
+
__RΦ.m("rt:t", () => __RΦ.a(1467))(getPropertyConversionOptions);
|
|
87
90
|
function PropDecoratorFactory(options) {
|
|
88
91
|
return __RΦ.f(function (prototype, property) {
|
|
89
92
|
const _options = resolvePropertyConversionOptions(options || {}, prototype.constructor, property);
|
|
90
93
|
storePropertyConversionOptions(prototype.constructor, property, _options);
|
|
91
|
-
}, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(
|
|
94
|
+
}, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1478), v: null }]), __RΦ.m("rt:f", "M."), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
92
95
|
}
|
|
93
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
96
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1474), v: null, f: "?" }])(PropDecoratorFactory);
|
|
94
97
|
__RΦ.m("rt:f", "F")(PropDecoratorFactory);
|
|
95
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
98
|
+
__RΦ.m("rt:t", () => __RΦ.a(1476))(PropDecoratorFactory);
|
|
96
99
|
export { PropDecoratorFactory as Prop };
|
|
@@ -13,21 +13,21 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
13
13
|
__RΦ.t[id] = t = l;
|
|
14
14
|
}
|
|
15
15
|
return t;
|
|
16
|
-
}, t: { [
|
|
16
|
+
}, t: { [1363]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1334)] }) }, [214]: { TΦ: "5", name: "XMLModelPropertyOptions" }, [1334]: { LΦ: t => Object }, [1367]: { LΦ: t => Object }, [493]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(375)] }) }, [375]: { LΦ: t => Object }, [107]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(105) }) }, [105]: { LΦ: t => LΦ_0.IΦXMLElement }, [496]: { LΦ: t => Object }, [497]: { LΦ: t => LΦ_1.ReflectedProperty }, [13]: { LΦ: t => String }, [20]: { LΦ: t => Boolean }, [505]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1)] }) }, [502]: { LΦ: t => LΦ_2.XMLModel }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [357]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(20), p: [{ n: "element", t: () => __RΦ.a(105), v: null }, { n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [399]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(400), p: [__RΦ.a(377), __RΦ.a(378)] }) }, [400]: { LΦ: t => Object }, [377]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(374), p: [__RΦ.a(215)] }) }, [374]: { TΦ: "5", name: "PropertyFromXMLContext" }, [215]: { LΦ: t => Object }, [378]: { LΦ: t => "elements" }, [1214]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(107), p: [{ n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [1216]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(1329), p: [{ n: "context", t: () => __RΦ.a(377), v: null }], f: "" }) }, [1329]: { LΦ: t => Object }, [1218]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(111), p: [{ n: "context", t: () => __RΦ.a(1336), v: null }], f: "" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1336]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1333), p: [__RΦ.a(215)] }) }, [1333]: { TΦ: "5", name: "PropertyToXMLContext" }, [1379]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(74), __RΦ.a(1378)] }) }, [74]: { LΦ: t => RegExp }, [1378]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [1270]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1339]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1292]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [506]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(505)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [610]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(602)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [602]: { TΦ: "5", name: "ConversionOptions" }, [613]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(612) }) }, [612]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [656]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(657), p: [__RΦ.a(381)] }) }, [657]: { LΦ: t => Object }, [381]: { LΦ: t => Object }, [519]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(381)] }) }, [861]: { LΦ: t => Object }, [888]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(889), p: [__RΦ.a(861)] }) }, [889]: { LΦ: t => Object }, [926]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(861)] }) }, [528]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(523)] }) }, [523]: { LΦ: t => Object }, [660]: { RΦ: t => ({ TΦ: "O", m: [{ n: "fromXML", f: "", t: __RΦ.a(667) }, { n: "toXML", f: "", t: __RΦ.a(898) }, { n: "options", f: "", t: __RΦ.a(1067) }] }) }, [667]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(663), __RΦ.a(665)] }) }, [663]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(664), p: [__RΦ.a(606), __RΦ.a(384)] }) }, [664]: { LΦ: t => Object }, [606]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(380), p: [__RΦ.a(523)] }) }, [380]: { TΦ: "5", name: "fromXMLContext" }, [384]: { LΦ: t => "properties" }, [665]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(666), p: [__RΦ.a(523)] }) }, [666]: { LΦ: t => Object }, [898]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(894), __RΦ.a(896)] }) }, [894]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(895), p: [__RΦ.a(863), __RΦ.a(384)] }) }, [895]: { LΦ: t => Object }, [863]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(523)] }) }, [860]: { TΦ: "5", name: "toXMLContext" }, [896]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(897), p: [__RΦ.a(523)] }) }, [897]: { LΦ: t => Object }, [1067]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1055), p: [__RΦ.a(1065), __RΦ.a(1066)] }) }, [1055]: { LΦ: t => Map }, [1065]: { LΦ: t => Object }, [1066]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(523)] }) }, [607]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(606), __RΦ.a(523)] }) }, [864]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(863), __RΦ.a(111)] }) }, [1912]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1911)] }) }, [1911]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1623)] }) }, [1623]: { LΦ: t => Object }, [1644]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1634]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) } } };
|
|
17
17
|
var IΦPropertyToXMLContext = { name: "PropertyToXMLContext", prototype: {}, identity: Symbol("PropertyToXMLContext (interface)") };
|
|
18
18
|
export { IΦPropertyToXMLContext };
|
|
19
|
-
(t => __RΦ.t[
|
|
19
|
+
(t => __RΦ.t[1333] = t)(IΦPropertyToXMLContext);
|
|
20
20
|
__RΦ.m("rt:P", ["property", "value"])(IΦPropertyToXMLContext);
|
|
21
21
|
__RΦ.m("rt:m", [])(IΦPropertyToXMLContext);
|
|
22
22
|
__RΦ.m("rt:i", [() => IΦOmit])(IΦPropertyToXMLContext);
|
|
23
23
|
__RΦ.m("rt:f", "Ie")(IΦPropertyToXMLContext);
|
|
24
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
24
|
+
__RΦ.m("rt:t", () => __RΦ.a(1363))(IΦPropertyToXMLContext.prototype, "property");
|
|
25
25
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "property");
|
|
26
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
26
|
+
__RΦ.m("rt:t", () => __RΦ.a(1367))(IΦPropertyToXMLContext.prototype, "value");
|
|
27
27
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "value");
|
|
28
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
28
|
+
__RΦ.m("rt:t", () => __RΦ.a(1363))(IΦPropertyToXMLContext.prototype, "property");
|
|
29
29
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "property");
|
|
30
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
30
|
+
__RΦ.m("rt:t", () => __RΦ.a(1367))(IΦPropertyToXMLContext.prototype, "value");
|
|
31
31
|
__RΦ.m("rt:f", "P")(IΦPropertyToXMLContext.prototype, "value");
|
|
32
32
|
import * as LΦ_0 from "../types";
|
|
33
33
|
var IΦPropertyFromXMLContext = { name: "PropertyFromXMLContext", prototype: {}, identity: Symbol("PropertyFromXMLContext (interface)") };
|
|
@@ -67,11 +67,11 @@ __RΦ.m("rt:t", () => __RΦ.a(505))(IΦXMLModelPropertyOptions.prototype, "model
|
|
|
67
67
|
__RΦ.m("rt:f", "P?")(IΦXMLModelPropertyOptions.prototype, "model");
|
|
68
68
|
__RΦ.m("rt:t", () => __RΦ.a(357))(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
69
69
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
70
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
70
|
+
__RΦ.m("rt:t", () => __RΦ.a(1214))(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
71
71
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
72
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
72
|
+
__RΦ.m("rt:t", () => __RΦ.a(1216))(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
73
73
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
74
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
74
|
+
__RΦ.m("rt:t", () => __RΦ.a(1218))(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
75
75
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
76
76
|
__RΦ.m("rt:t", () => __RΦ.a(496))(IΦXMLModelPropertyOptions.prototype, "name");
|
|
77
77
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "name");
|
|
@@ -87,11 +87,11 @@ __RΦ.m("rt:t", () => __RΦ.a(505))(IΦXMLModelPropertyOptions.prototype, "model
|
|
|
87
87
|
__RΦ.m("rt:f", "P?")(IΦXMLModelPropertyOptions.prototype, "model");
|
|
88
88
|
__RΦ.m("rt:t", () => __RΦ.a(357))(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
89
89
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "isSourceElement");
|
|
90
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
90
|
+
__RΦ.m("rt:t", () => __RΦ.a(1214))(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
91
91
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "resolveElements");
|
|
92
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
92
|
+
__RΦ.m("rt:t", () => __RΦ.a(1216))(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
93
93
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "fromXML");
|
|
94
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
94
|
+
__RΦ.m("rt:t", () => __RΦ.a(1218))(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
95
95
|
__RΦ.m("rt:f", "P")(IΦXMLModelPropertyOptions.prototype, "toXML");
|
|
96
96
|
var IΦCreateXMLModelPropertyOptions = { name: "CreateXMLModelPropertyOptions", prototype: {}, identity: Symbol("CreateXMLModelPropertyOptions (interface)") };
|
|
97
97
|
export { IΦCreateXMLModelPropertyOptions };
|
|
@@ -101,13 +101,13 @@ __RΦ.m("rt:m", [])(IΦCreateXMLModelPropertyOptions);
|
|
|
101
101
|
__RΦ.m("rt:f", "Ie")(IΦCreateXMLModelPropertyOptions);
|
|
102
102
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
103
103
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
104
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
104
|
+
__RΦ.m("rt:t", () => __RΦ.a(1379))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
105
105
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
106
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
106
|
+
__RΦ.m("rt:t", () => __RΦ.a(1270))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
107
107
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
108
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
108
|
+
__RΦ.m("rt:t", () => __RΦ.a(1339))(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
109
109
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
110
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
110
|
+
__RΦ.m("rt:t", () => __RΦ.a(1292))(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
111
111
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
112
112
|
__RΦ.m("rt:t", () => __RΦ.a(20))(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
113
113
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
@@ -117,13 +117,13 @@ __RΦ.m("rt:t", () => __RΦ.a(506))(IΦCreateXMLModelPropertyOptions.prototype,
|
|
|
117
117
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "model");
|
|
118
118
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
119
119
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "tagname");
|
|
120
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
120
|
+
__RΦ.m("rt:t", () => __RΦ.a(1379))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
121
121
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
122
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
122
|
+
__RΦ.m("rt:t", () => __RΦ.a(1270))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
123
123
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
124
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
124
|
+
__RΦ.m("rt:t", () => __RΦ.a(1339))(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
125
125
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "toXML");
|
|
126
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
126
|
+
__RΦ.m("rt:t", () => __RΦ.a(1292))(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
127
127
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "fromXML");
|
|
128
128
|
__RΦ.m("rt:t", () => __RΦ.a(20))(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
129
129
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "inline");
|
|
@@ -208,23 +208,23 @@ __RΦ.m("rt:t", () => __RΦ.a(13))(IΦXMLModelOptions.prototype, "tagname");
|
|
|
208
208
|
__RΦ.m("rt:f", "P")(IΦXMLModelOptions.prototype, "tagname");
|
|
209
209
|
var IΦCreateXMLModelOptions = { name: "CreateXMLModelOptions", prototype: {}, identity: Symbol("CreateXMLModelOptions (interface)") };
|
|
210
210
|
export { IΦCreateXMLModelOptions };
|
|
211
|
-
(t => __RΦ.t[
|
|
211
|
+
(t => __RΦ.t[1622] = t)(IΦCreateXMLModelOptions);
|
|
212
212
|
__RΦ.m("rt:P", ["parent", "fromXML", "toXML", "tagname"])(IΦCreateXMLModelOptions);
|
|
213
213
|
__RΦ.m("rt:m", [])(IΦCreateXMLModelOptions);
|
|
214
214
|
__RΦ.m("rt:f", "Ie")(IΦCreateXMLModelOptions);
|
|
215
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
215
|
+
__RΦ.m("rt:t", () => __RΦ.a(1912))(IΦCreateXMLModelOptions.prototype, "parent");
|
|
216
216
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "parent");
|
|
217
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
217
|
+
__RΦ.m("rt:t", () => __RΦ.a(1644))(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
218
218
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
219
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
219
|
+
__RΦ.m("rt:t", () => __RΦ.a(1634))(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
220
220
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
221
221
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelOptions.prototype, "tagname");
|
|
222
222
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "tagname");
|
|
223
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
223
|
+
__RΦ.m("rt:t", () => __RΦ.a(1912))(IΦCreateXMLModelOptions.prototype, "parent");
|
|
224
224
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "parent");
|
|
225
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
225
|
+
__RΦ.m("rt:t", () => __RΦ.a(1644))(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
226
226
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "fromXML");
|
|
227
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
227
|
+
__RΦ.m("rt:t", () => __RΦ.a(1634))(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
228
228
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "toXML");
|
|
229
229
|
__RΦ.m("rt:t", () => __RΦ.a(13))(IΦCreateXMLModelOptions.prototype, "tagname");
|
|
230
230
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelOptions.prototype, "tagname");
|
|
@@ -19,7 +19,7 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
|
|
|
19
19
|
__RΦ.t[id] = t = l;
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
|
-
}, t: { [
|
|
22
|
+
}, t: { [2761]: { RΦ: t => ({ TΦ: "O", m: [{ n: "propA", f: "", t: __RΦ.a(13) }, { n: "propB", f: "", t: __RΦ.a(20) }, { n: "propC", f: "", t: __RΦ.a(2777) }, { n: "propD", f: "", t: __RΦ.a(705) }, { n: "__constructor", f: "", t: __RΦ.a(4) }] }) }, [13]: { LΦ: t => String }, [20]: { LΦ: t => Boolean }, [2777]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2775) }) }, [2775]: { TΦ: "5", name: "B" }, [705]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(47), __RΦ.a(135)] }) }, [47]: { LΦ: t => 0 }, [135]: { LΦ: t => 1 }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [2713]: { RΦ: t => ({ TΦ: "O", m: [{ n: "name", f: "", t: __RΦ.a(13) }, { n: "nbPages", f: "", t: __RΦ.a(14) }] }) }, [14]: { LΦ: t => Number }, [2732]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2676) }) }, [2676]: { TΦ: "5", name: "Book" }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [101]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(102), p: [] }) }, [102]: { LΦ: t => Object } } };
|
|
23
23
|
import "mocha";
|
|
24
24
|
import { expect, assert } from "chai";
|
|
25
25
|
import "reflect-metadata";
|
|
@@ -39,12 +39,12 @@ Book = __decorate([
|
|
|
39
39
|
},
|
|
40
40
|
})
|
|
41
41
|
], Book);
|
|
42
|
-
(t => __RΦ.t[
|
|
42
|
+
(t => __RΦ.t[2676] = t)(Book);
|
|
43
43
|
__RΦ.m("rt:SP", [])(Book);
|
|
44
44
|
__RΦ.m("rt:P", ["name", "nbPages"])(Book);
|
|
45
45
|
__RΦ.m("rt:Sm", [])(Book);
|
|
46
46
|
__RΦ.m("rt:m", ["fromXML"])(Book);
|
|
47
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
47
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(2713), v: null }])(Book);
|
|
48
48
|
__RΦ.m("rt:f", "C")(Book);
|
|
49
49
|
__RΦ.m("rt:t", () => __RΦ.a(13))(Book.prototype, "name");
|
|
50
50
|
__RΦ.m("rt:f", "P")(Book.prototype, "name");
|
|
@@ -64,16 +64,16 @@ Library = __decorate([
|
|
|
64
64
|
},
|
|
65
65
|
})
|
|
66
66
|
], Library);
|
|
67
|
-
(t => __RΦ.t[
|
|
67
|
+
(t => __RΦ.t[2716] = t)(Library);
|
|
68
68
|
__RΦ.m("rt:SP", [])(Library);
|
|
69
69
|
__RΦ.m("rt:P", ["name", "books"])(Library);
|
|
70
70
|
__RΦ.m("rt:Sm", [])(Library);
|
|
71
71
|
__RΦ.m("rt:m", ["fromXML"])(Library);
|
|
72
|
-
__RΦ.m("rt:p", [{ n: "name", t: () => __RΦ.a(13), v: null }, { n: "books", t: () => __RΦ.a(
|
|
72
|
+
__RΦ.m("rt:p", [{ n: "name", t: () => __RΦ.a(13), v: null }, { n: "books", t: () => __RΦ.a(2732), v: null, f: "3" }])(Library);
|
|
73
73
|
__RΦ.m("rt:f", "C")(Library);
|
|
74
74
|
__RΦ.m("rt:t", () => __RΦ.a(13))(Library.prototype, "name");
|
|
75
75
|
__RΦ.m("rt:f", "P")(Library.prototype, "name");
|
|
76
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
76
|
+
__RΦ.m("rt:t", () => __RΦ.a(2732))(Library.prototype, "books");
|
|
77
77
|
__RΦ.m("rt:f", "P")(Library.prototype, "books");
|
|
78
78
|
describe("Library Example", __RΦ.f(() => {
|
|
79
79
|
const library = new Library("test");
|
|
@@ -127,7 +127,7 @@ A = __decorate([
|
|
|
127
127
|
},
|
|
128
128
|
})
|
|
129
129
|
], A);
|
|
130
|
-
(t => __RΦ.t[
|
|
130
|
+
(t => __RΦ.t[2762] = t)(A);
|
|
131
131
|
__RΦ.m("rt:SP", [])(A);
|
|
132
132
|
__RΦ.m("rt:P", ["propA", "propB", "propC", "propD"])(A);
|
|
133
133
|
__RΦ.m("rt:Sm", [])(A);
|
|
@@ -138,7 +138,7 @@ __RΦ.m("rt:t", () => __RΦ.a(13))(A.prototype, "propA");
|
|
|
138
138
|
__RΦ.m("rt:f", "P")(A.prototype, "propA");
|
|
139
139
|
__RΦ.m("rt:t", () => __RΦ.a(20))(A.prototype, "propB");
|
|
140
140
|
__RΦ.m("rt:f", "P")(A.prototype, "propB");
|
|
141
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
141
|
+
__RΦ.m("rt:t", () => __RΦ.a(2777))(A.prototype, "propC");
|
|
142
142
|
__RΦ.m("rt:f", "P")(A.prototype, "propC");
|
|
143
143
|
__RΦ.m("rt:t", () => __RΦ.a(705))(A.prototype, "propD");
|
|
144
144
|
__RΦ.m("rt:f", "P")(A.prototype, "propD");
|
|
@@ -158,7 +158,7 @@ B = __decorate([
|
|
|
158
158
|
},
|
|
159
159
|
})
|
|
160
160
|
], B);
|
|
161
|
-
(t => __RΦ.t[
|
|
161
|
+
(t => __RΦ.t[2775] = t)(B);
|
|
162
162
|
__RΦ.m("rt:SP", [])(B);
|
|
163
163
|
__RΦ.m("rt:P", ["propA"])(B);
|
|
164
164
|
__RΦ.m("rt:Sm", [])(B);
|
|
@@ -181,8 +181,8 @@ describe("Edgy Cases", __RΦ.f(() => {
|
|
|
181
181
|
<propd>${instance.propD}</propd>
|
|
182
182
|
</a>`));
|
|
183
183
|
it("should give right type infos", __RΦ.f(() => {
|
|
184
|
-
const reflectedA = reflect(A, { TΦ: "c", t: void 0, p: [__RΦ.a(
|
|
185
|
-
assert(reflectedA === reflect(A, { TΦ: "c", t: void 0, p: [__RΦ.a(
|
|
184
|
+
const reflectedA = reflect(A, { TΦ: "c", t: void 0, p: [__RΦ.a(2761)], r: void 0, tp: [] });
|
|
185
|
+
assert(reflectedA === reflect(A, { TΦ: "c", t: void 0, p: [__RΦ.a(2761)], r: void 0, tp: [] }));
|
|
186
186
|
expect(reflectedA.getProperty("propA").type.isClass(String)).to.be.true;
|
|
187
187
|
expect(reflectedA.getProperty("propB").type.isClass(Boolean)).to.be.true;
|
|
188
188
|
const ModelAPropCType = reflectedA.getProperty("propC").type;
|
|
@@ -209,7 +209,7 @@ let C = class C extends B {
|
|
|
209
209
|
C = __decorate([
|
|
210
210
|
Model()
|
|
211
211
|
], C);
|
|
212
|
-
(t => __RΦ.t[
|
|
212
|
+
(t => __RΦ.t[2820] = t)(C);
|
|
213
213
|
__RΦ.m("rt:SP", [])(C);
|
|
214
214
|
__RΦ.m("rt:P", ["propB"])(C);
|
|
215
215
|
__RΦ.m("rt:Sm", [])(C);
|