xml-model 0.2.5 → 0.2.6
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/model/index.js +20 -20
- package/build/main/model/property.js +13 -10
- package/build/main/model/types.js +10 -10
- package/build/main/model.spec.js +12 -12
- package/build/module/defaults/models.js +2 -2
- package/build/module/model/index.js +20 -20
- package/build/module/model/property.js +13 -10
- package/build/module/model/types.js +10 -10
- 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(3125) }] }) }, [3125]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(3123) }) }, [3123]: { 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"),
|
|
@@ -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 }, [1716]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1719]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1716), __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Φ: "~" }) }, [1742]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1751]: { 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 }, [1775]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1328)] }) }, [1328]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(422), __RΦ.a(1326)] }) }, [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" }, [1326]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1327), p: [__RΦ.a(1)] }) }, [1327]: { LΦ: t => Object }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [658]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(659), p: [__RΦ.a(503)] }) }, [659]: { LΦ: t => Object }, [1785]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1783)] }) }, [1783]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1360), __RΦ.a(1781)] }) }, [1360]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1361), p: [__RΦ.a(1359), __RΦ.a(384)] }) }, [1361]: { LΦ: t => Object }, [1359]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(1)] }) }, [860]: { LΦ: t => require("./types").IΦtoXMLContext }, [1781]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1782), p: [__RΦ.a(1)] }) }, [1782]: { 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(1074) }] }) }, [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 }, [1074]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1064), p: [__RΦ.a(1072), __RΦ.a(1073)] }) }, [1064]: { LΦ: t => Map }, [1072]: { LΦ: t => Object }, [1073]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(523)] }) }, [214]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [1801]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1799)] }) }, [1799]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1806]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1804)] }) }, [1804]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1359), __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 }, [1069]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1064), p: [__RΦ.a(13), __RΦ.a(1063)] }) }, [1063]: { RΦ: t => ({ TΦ: "&", t: [__RΦ.a(1061), __RΦ.a(1062)] }) }, [1061]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1)] }) }, [1062]: { 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)] }) }, [1724]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1721)] }) }, [1721]: { LΦ: t => Object }, [1737]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1736)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1736]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1721)] }) }, [1882]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1881)] }) }, [1881]: { LΦ: t => Object }, [1885]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1881)] }) }, [1888]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(1887)] }) }, [1887]: { LΦ: t => Object }, [1890]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1891), v: null }], f: "" }) }, [1891]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1887)] }) } } };
|
|
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(1716), 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(1719))(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(1742))(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(1742))], "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) {
|
|
@@ -244,19 +244,19 @@ __RΦ.m("rt:SP", [])(XMLModel);
|
|
|
244
244
|
__RΦ.m("rt:P", ["options", "type", "reflectedClass"])(XMLModel);
|
|
245
245
|
__RΦ.m("rt:Sm", [])(XMLModel);
|
|
246
246
|
__RΦ.m("rt:m", ["fromXML", "toXML", "resolveAllProperties"])(XMLModel);
|
|
247
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(
|
|
247
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1751), v: null }])(XMLModel);
|
|
248
248
|
__RΦ.m("rt:f", "Ce")(XMLModel);
|
|
249
249
|
__RΦ.m("rt:t", () => __RΦ.a(525))(XMLModel.prototype, "options");
|
|
250
250
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "options");
|
|
251
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
251
|
+
__RΦ.m("rt:t", () => __RΦ.a(1775))(XMLModel.prototype, "parent");
|
|
252
252
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
253
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
253
|
+
__RΦ.m("rt:t", () => __RΦ.a(1785))(XMLModel.prototype, "parent");
|
|
254
254
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
255
255
|
__RΦ.m("rt:t", () => __RΦ.a(661))(XMLModel.prototype, "properties");
|
|
256
256
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
|
|
257
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
257
|
+
__RΦ.m("rt:t", () => __RΦ.a(1801))(XMLModel.prototype, "parent");
|
|
258
258
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
259
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
259
|
+
__RΦ.m("rt:t", () => __RΦ.a(1806))(XMLModel.prototype, "parent");
|
|
260
260
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
261
261
|
__RΦ.m("rt:t", () => __RΦ.a(13))(XMLModel.prototype, "tagname");
|
|
262
262
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "tagname");
|
|
@@ -290,17 +290,17 @@ function createModel(type, options) {
|
|
|
290
290
|
return model;
|
|
291
291
|
}
|
|
292
292
|
exports.createModel = createModel;
|
|
293
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(
|
|
293
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1626), v: null }, { n: "options", t: () => __RΦ.a(1625), v: null }])(createModel);
|
|
294
294
|
__RΦ.m("rt:f", "F")(createModel);
|
|
295
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
295
|
+
__RΦ.m("rt:t", () => __RΦ.a(1659))(createModel);
|
|
296
296
|
exports.Models = new Map();
|
|
297
297
|
function findModel(id) {
|
|
298
298
|
return exports.Models.get(id);
|
|
299
299
|
}
|
|
300
300
|
exports.findModel = findModel;
|
|
301
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
301
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1724), v: null }])(findModel);
|
|
302
302
|
__RΦ.m("rt:f", "F")(findModel);
|
|
303
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
303
|
+
__RΦ.m("rt:t", () => __RΦ.a(1737))(findModel);
|
|
304
304
|
function getModel(id) {
|
|
305
305
|
const model = findModel(id);
|
|
306
306
|
if (model)
|
|
@@ -309,19 +309,19 @@ function getModel(id) {
|
|
|
309
309
|
throw new TypeError(`couln't find model for type ${id.name}`);
|
|
310
310
|
}
|
|
311
311
|
exports.getModel = getModel;
|
|
312
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
312
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1882), v: null }])(getModel);
|
|
313
313
|
__RΦ.m("rt:f", "F")(getModel);
|
|
314
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
314
|
+
__RΦ.m("rt:t", () => __RΦ.a(1885))(getModel);
|
|
315
315
|
// Model decorator
|
|
316
316
|
function ModelDecoratorFactory(options) {
|
|
317
317
|
return __RΦ.f(function (constructor) {
|
|
318
318
|
findModel(constructor) || createModel(constructor, options || {});
|
|
319
|
-
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
319
|
+
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1891), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
320
320
|
}
|
|
321
321
|
exports.Model = ModelDecoratorFactory;
|
|
322
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
322
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1888), v: null, f: "?" }])(ModelDecoratorFactory);
|
|
323
323
|
__RΦ.m("rt:f", "F")(ModelDecoratorFactory);
|
|
324
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
324
|
+
__RΦ.m("rt:t", () => __RΦ.a(1890))(ModelDecoratorFactory);
|
|
325
325
|
var property_2 = require("./property");
|
|
326
326
|
Object.defineProperty(exports, "Prop", { enumerable: true, get: function () { return property_2.Prop; } });
|
|
327
327
|
require("../defaults/models");
|
|
@@ -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,7 +16,7 @@ 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: { [1370]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1341)] }) }, [214]: { TΦ: "5", name: "XMLModelPropertyOptions" }, [1341]: { LΦ: t => Object }, [1374]: { 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" }, [1221]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(107), p: [{ n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [1223]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(1336), p: [{ n: "context", t: () => __RΦ.a(377), v: null }], f: "" }) }, [1336]: { LΦ: t => Object }, [1225]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(111), p: [{ n: "context", t: () => __RΦ.a(1343), v: null }], f: "" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1343]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1340), p: [__RΦ.a(215)] }) }, [1340]: { TΦ: "5", name: "PropertyToXMLContext" }, [
|
|
19
|
+
}, t: { [1370]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1341)] }) }, [214]: { TΦ: "5", name: "XMLModelPropertyOptions" }, [1341]: { LΦ: t => Object }, [1374]: { 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" }, [1221]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(107), p: [{ n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [1223]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(1336), p: [{ n: "context", t: () => __RΦ.a(377), v: null }], f: "" }) }, [1336]: { LΦ: t => Object }, [1225]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(111), p: [{ n: "context", t: () => __RΦ.a(1343), v: null }], f: "" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1343]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1340), p: [__RΦ.a(215)] }) }, [1340]: { TΦ: "5", name: "PropertyToXMLContext" }, [1386]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(74), __RΦ.a(1385)] }) }, [74]: { LΦ: t => RegExp }, [1385]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [1277]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1346]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1299]: { 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(1074) }] }) }, [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 }, [1074]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1064), p: [__RΦ.a(1072), __RΦ.a(1073)] }) }, [1064]: { LΦ: t => Map }, [1072]: { LΦ: t => Object }, [1073]: { 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)] }) }, [1817]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1816)] }) }, [1816]: { 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
22
|
(t => __RΦ.t[1340] = t)(IΦPropertyToXMLContext);
|
|
@@ -101,7 +101,7 @@ __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(1386))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
105
105
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
106
106
|
__RΦ.m("rt:t", () => __RΦ.a(1277))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
107
107
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
@@ -117,7 +117,7 @@ __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(1386))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
121
121
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
122
122
|
__RΦ.m("rt:t", () => __RΦ.a(1277))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
123
123
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
@@ -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(1817))(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(1817))(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: { [2702]: { 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(2718) }, { n: "propD", f: "", t: __RΦ.a(705) }, { n: "__constructor", f: "", t: __RΦ.a(4) }] }) }, [13]: { LΦ: t => String }, [20]: { LΦ: t => Boolean }, [2718]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2716) }) }, [2716]: { 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Φ: "~" }) }, [2654]: { RΦ: t => ({ TΦ: "O", m: [{ n: "name", f: "", t: __RΦ.a(13) }, { n: "nbPages", f: "", t: __RΦ.a(14) }] }) }, [14]: { LΦ: t => Number }, [2673]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2617) }) }, [2617]: { 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[2617] = 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(2654), 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[2657] = 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(2673), 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(2673))(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[2703] = 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(2718))(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[2716] = 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(2702)], r: void 0, tp: [] });
|
|
190
|
+
(0, chai_1.assert)(reflectedA === (0, typescript_rtti_1.reflect)(A, { TΦ: "c", t: void 0, p: [__RΦ.a(2702)], 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[2766] = 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(3125) }] }) }, [3125]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(3123) }) }, [3123]: { 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"),
|
|
@@ -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 }, [1716]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1719]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1716), __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Φ: "~" }) }, [1742]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1751]: { 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 }, [1775]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1328)] }) }, [1328]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(422), __RΦ.a(1326)] }) }, [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" }, [1326]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1327), p: [__RΦ.a(1)] }) }, [1327]: { LΦ: t => Object }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [658]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(659), p: [__RΦ.a(503)] }) }, [659]: { LΦ: t => Object }, [1785]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1783)] }) }, [1783]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1360), __RΦ.a(1781)] }) }, [1360]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1361), p: [__RΦ.a(1359), __RΦ.a(384)] }) }, [1361]: { LΦ: t => Object }, [1359]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(860), p: [__RΦ.a(1)] }) }, [860]: { LΦ: t => LΦ_1.IΦtoXMLContext }, [1781]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1782), p: [__RΦ.a(1)] }) }, [1782]: { 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(1074) }] }) }, [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 }, [1074]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1064), p: [__RΦ.a(1072), __RΦ.a(1073)] }) }, [1064]: { LΦ: t => Map }, [1072]: { LΦ: t => Object }, [1073]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(523)] }) }, [214]: { LΦ: t => LΦ_1.IΦXMLModelPropertyOptions }, [1801]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1799)] }) }, [1799]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1806]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1804)] }) }, [1804]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1359), __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 }, [1069]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1064), p: [__RΦ.a(13), __RΦ.a(1063)] }) }, [1063]: { RΦ: t => ({ TΦ: "&", t: [__RΦ.a(1061), __RΦ.a(1062)] }) }, [1061]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1)] }) }, [1062]: { 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)] }) }, [1724]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1721)] }) }, [1721]: { LΦ: t => Object }, [1737]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1736)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1736]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1721)] }) }, [1882]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1881)] }) }, [1881]: { LΦ: t => Object }, [1885]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1881)] }) }, [1888]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1622), p: [__RΦ.a(1887)] }) }, [1887]: { LΦ: t => Object }, [1890]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1891), v: null }], f: "" }) }, [1891]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1887)] }) } } };
|
|
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(1716), 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(1719))(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(1742))(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(1742))], "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) {
|
|
@@ -240,19 +240,19 @@ __RΦ.m("rt:SP", [])(XMLModel);
|
|
|
240
240
|
__RΦ.m("rt:P", ["options", "type", "reflectedClass"])(XMLModel);
|
|
241
241
|
__RΦ.m("rt:Sm", [])(XMLModel);
|
|
242
242
|
__RΦ.m("rt:m", ["fromXML", "toXML", "resolveAllProperties"])(XMLModel);
|
|
243
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(
|
|
243
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1751), v: null }])(XMLModel);
|
|
244
244
|
__RΦ.m("rt:f", "Ce")(XMLModel);
|
|
245
245
|
__RΦ.m("rt:t", () => __RΦ.a(525))(XMLModel.prototype, "options");
|
|
246
246
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "options");
|
|
247
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
247
|
+
__RΦ.m("rt:t", () => __RΦ.a(1775))(XMLModel.prototype, "parent");
|
|
248
248
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
249
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
249
|
+
__RΦ.m("rt:t", () => __RΦ.a(1785))(XMLModel.prototype, "parent");
|
|
250
250
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
251
251
|
__RΦ.m("rt:t", () => __RΦ.a(661))(XMLModel.prototype, "properties");
|
|
252
252
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
|
|
253
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
253
|
+
__RΦ.m("rt:t", () => __RΦ.a(1801))(XMLModel.prototype, "parent");
|
|
254
254
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
255
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
255
|
+
__RΦ.m("rt:t", () => __RΦ.a(1806))(XMLModel.prototype, "parent");
|
|
256
256
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
|
|
257
257
|
__RΦ.m("rt:t", () => __RΦ.a(13))(XMLModel.prototype, "tagname");
|
|
258
258
|
__RΦ.m("rt:f", "P")(XMLModel.prototype, "tagname");
|
|
@@ -285,16 +285,16 @@ export function createModel(type, options) {
|
|
|
285
285
|
Models.set(type, model);
|
|
286
286
|
return model;
|
|
287
287
|
}
|
|
288
|
-
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(
|
|
288
|
+
__RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1626), v: null }, { n: "options", t: () => __RΦ.a(1625), v: null }])(createModel);
|
|
289
289
|
__RΦ.m("rt:f", "F")(createModel);
|
|
290
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
290
|
+
__RΦ.m("rt:t", () => __RΦ.a(1659))(createModel);
|
|
291
291
|
export const Models = new Map();
|
|
292
292
|
export function findModel(id) {
|
|
293
293
|
return Models.get(id);
|
|
294
294
|
}
|
|
295
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
295
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1724), v: null }])(findModel);
|
|
296
296
|
__RΦ.m("rt:f", "F")(findModel);
|
|
297
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
297
|
+
__RΦ.m("rt:t", () => __RΦ.a(1737))(findModel);
|
|
298
298
|
export function getModel(id) {
|
|
299
299
|
const model = findModel(id);
|
|
300
300
|
if (model)
|
|
@@ -302,18 +302,18 @@ export function getModel(id) {
|
|
|
302
302
|
else
|
|
303
303
|
throw new TypeError(`couln't find model for type ${id.name}`);
|
|
304
304
|
}
|
|
305
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
305
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1882), v: null }])(getModel);
|
|
306
306
|
__RΦ.m("rt:f", "F")(getModel);
|
|
307
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
307
|
+
__RΦ.m("rt:t", () => __RΦ.a(1885))(getModel);
|
|
308
308
|
// Model decorator
|
|
309
309
|
function ModelDecoratorFactory(options) {
|
|
310
310
|
return __RΦ.f(function (constructor) {
|
|
311
311
|
findModel(constructor) || createModel(constructor, options || {});
|
|
312
|
-
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
312
|
+
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1891), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
313
313
|
}
|
|
314
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
314
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1888), v: null, f: "?" }])(ModelDecoratorFactory);
|
|
315
315
|
__RΦ.m("rt:f", "F")(ModelDecoratorFactory);
|
|
316
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
316
|
+
__RΦ.m("rt:t", () => __RΦ.a(1890))(ModelDecoratorFactory);
|
|
317
317
|
export { ModelDecoratorFactory as Model };
|
|
318
318
|
export { Prop } from "./property";
|
|
319
319
|
import "../defaults/models";
|
|
@@ -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,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: { [1370]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1341)] }) }, [214]: { TΦ: "5", name: "XMLModelPropertyOptions" }, [1341]: { LΦ: t => Object }, [1374]: { 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" }, [1221]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(107), p: [{ n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [1223]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(1336), p: [{ n: "context", t: () => __RΦ.a(377), v: null }], f: "" }) }, [1336]: { LΦ: t => Object }, [1225]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(111), p: [{ n: "context", t: () => __RΦ.a(1343), v: null }], f: "" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1343]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1340), p: [__RΦ.a(215)] }) }, [1340]: { TΦ: "5", name: "PropertyToXMLContext" }, [
|
|
16
|
+
}, t: { [1370]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1341)] }) }, [214]: { TΦ: "5", name: "XMLModelPropertyOptions" }, [1341]: { LΦ: t => Object }, [1374]: { 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" }, [1221]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(107), p: [{ n: "context", t: () => __RΦ.a(399), v: null }], f: "" }) }, [1223]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(1336), p: [{ n: "context", t: () => __RΦ.a(377), v: null }], f: "" }) }, [1336]: { LΦ: t => Object }, [1225]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(111), p: [{ n: "context", t: () => __RΦ.a(1343), v: null }], f: "" }) }, [111]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(107) }] }) }, [1343]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1340), p: [__RΦ.a(215)] }) }, [1340]: { TΦ: "5", name: "PropertyToXMLContext" }, [1386]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(74), __RΦ.a(1385)] }) }, [74]: { LΦ: t => RegExp }, [1385]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [1277]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1346]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1299]: { 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(1074) }] }) }, [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 }, [1074]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1064), p: [__RΦ.a(1072), __RΦ.a(1073)] }) }, [1064]: { LΦ: t => Map }, [1072]: { LΦ: t => Object }, [1073]: { 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)] }) }, [1817]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1816)] }) }, [1816]: { 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
19
|
(t => __RΦ.t[1340] = t)(IΦPropertyToXMLContext);
|
|
@@ -101,7 +101,7 @@ __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(1386))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
105
105
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
106
106
|
__RΦ.m("rt:t", () => __RΦ.a(1277))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
107
107
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
@@ -117,7 +117,7 @@ __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(1386))(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
121
121
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "sourceElements");
|
|
122
122
|
__RΦ.m("rt:t", () => __RΦ.a(1277))(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
123
123
|
__RΦ.m("rt:f", "P?")(IΦCreateXMLModelPropertyOptions.prototype, "resolveElements");
|
|
@@ -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(1817))(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(1817))(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: { [2702]: { 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(2718) }, { n: "propD", f: "", t: __RΦ.a(705) }, { n: "__constructor", f: "", t: __RΦ.a(4) }] }) }, [13]: { LΦ: t => String }, [20]: { LΦ: t => Boolean }, [2718]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2716) }) }, [2716]: { 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Φ: "~" }) }, [2654]: { RΦ: t => ({ TΦ: "O", m: [{ n: "name", f: "", t: __RΦ.a(13) }, { n: "nbPages", f: "", t: __RΦ.a(14) }] }) }, [14]: { LΦ: t => Number }, [2673]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2617) }) }, [2617]: { 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[2617] = 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(2654), 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[2657] = 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(2673), 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(2673))(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[2703] = 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(2718))(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[2716] = 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(2702)], r: void 0, tp: [] });
|
|
185
|
+
assert(reflectedA === reflect(A, { TΦ: "c", t: void 0, p: [__RΦ.a(2702)], 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[2766] = t)(C);
|
|
213
213
|
__RΦ.m("rt:SP", [])(C);
|
|
214
214
|
__RΦ.m("rt:P", ["propB"])(C);
|
|
215
215
|
__RΦ.m("rt:Sm", [])(C);
|