xml-model 0.2.4 → 0.2.5
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/model/index.js +17 -15
- package/build/module/model/index.js +17 -15
- package/package.json +1 -1
|
@@ -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 }, [1714]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1717]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1714), __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Φ: "~" }) }, [1740]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1749]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(503)] }) }, [1620]: { 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 }, [1773]: { 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 }, [1783]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1781)] }) }, [1781]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1360), __RΦ.a(1779)] }) }, [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 }, [1779]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1780), p: [__RΦ.a(1)] }) }, [1780]: { 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 }, [1799]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1797)] }) }, [1797]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1804]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1802)] }) }, [1802]: { 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) }] }) }, [1624]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1619)] }) }, [1619]: { LΦ: t => Object }, [1623]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(1619)] }) }, [1657]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1619)] }) }, [1722]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1719)] }) }, [1719]: { LΦ: t => Object }, [1735]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1734)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1734]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1719)] }) }, [
|
|
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 }, [1714]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1717]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1714), __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Φ: "~" }) }, [1740]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1749]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(503)] }) }, [1620]: { 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 }, [1773]: { 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 }, [1783]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1781)] }) }, [1781]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1360), __RΦ.a(1779)] }) }, [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 }, [1779]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1780), p: [__RΦ.a(1)] }) }, [1780]: { 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 }, [1799]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1797)] }) }, [1797]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1804]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1802)] }) }, [1802]: { 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) }] }) }, [1624]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1619)] }) }, [1619]: { LΦ: t => Object }, [1623]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(1619)] }) }, [1657]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1619)] }) }, [1722]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1719)] }) }, [1719]: { LΦ: t => Object }, [1735]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1734)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1734]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1719)] }) }, [1880]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1879)] }) }, [1879]: { LΦ: t => Object }, [1883]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1879)] }) }, [1886]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(1885)] }) }, [1885]: { LΦ: t => Object }, [1888]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1889), v: null }], f: "" }) }, [1889]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1885)] }) } } };
|
|
23
23
|
const typescript_rtti_1 = require("typescript-rtti");
|
|
24
24
|
const middleware_1 = require("../middleware");
|
|
25
25
|
const property_1 = require("./property");
|
|
@@ -222,17 +222,19 @@ class XMLModel {
|
|
|
222
222
|
const parent = getParentModel(this);
|
|
223
223
|
if (parent)
|
|
224
224
|
parent.resolveAllProperties().forEach(__RΦ.f((prop, key) => {
|
|
225
|
-
properties.delete(key); // delete prop if already present
|
|
226
225
|
properties.set(key, prop);
|
|
227
226
|
}, [__RΦ.m("rt:p", [{ n: "prop", 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))], ""));
|
|
228
|
-
this.options.properties.options.forEach(__RΦ.f((options, key) =>
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
227
|
+
this.options.properties.options.forEach(__RΦ.f((options, key) => {
|
|
228
|
+
properties.delete(key); // delete prop if already present to make sure it overrides parent's prop
|
|
229
|
+
properties.set(key, new Proxy(options, {
|
|
230
|
+
get: __RΦ.f((target, p, reciever) => {
|
|
231
|
+
if (p === "model")
|
|
232
|
+
return this;
|
|
233
|
+
else
|
|
234
|
+
return Reflect.get(target, p, reciever);
|
|
235
|
+
}, [__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"),
|
|
236
|
+
}));
|
|
237
|
+
}, [__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))], ""));
|
|
236
238
|
return properties;
|
|
237
239
|
}
|
|
238
240
|
}
|
|
@@ -307,19 +309,19 @@ function getModel(id) {
|
|
|
307
309
|
throw new TypeError(`couln't find model for type ${id.name}`);
|
|
308
310
|
}
|
|
309
311
|
exports.getModel = getModel;
|
|
310
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
312
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1880), v: null }])(getModel);
|
|
311
313
|
__RΦ.m("rt:f", "F")(getModel);
|
|
312
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
314
|
+
__RΦ.m("rt:t", () => __RΦ.a(1883))(getModel);
|
|
313
315
|
// Model decorator
|
|
314
316
|
function ModelDecoratorFactory(options) {
|
|
315
317
|
return __RΦ.f(function (constructor) {
|
|
316
318
|
findModel(constructor) || createModel(constructor, options || {});
|
|
317
|
-
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
319
|
+
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1889), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
318
320
|
}
|
|
319
321
|
exports.Model = ModelDecoratorFactory;
|
|
320
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
322
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1886), v: null, f: "?" }])(ModelDecoratorFactory);
|
|
321
323
|
__RΦ.m("rt:f", "F")(ModelDecoratorFactory);
|
|
322
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
324
|
+
__RΦ.m("rt:t", () => __RΦ.a(1888))(ModelDecoratorFactory);
|
|
323
325
|
var property_2 = require("./property");
|
|
324
326
|
Object.defineProperty(exports, "Prop", { enumerable: true, get: function () { return property_2.Prop; } });
|
|
325
327
|
require("../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: { [532]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(503)] }) }, [202]: { LΦ: t => LΦ_0.IΦConstructor }, [503]: { LΦ: t => Object }, [1714]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1717]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1714), __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Φ: "~" }) }, [1740]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1749]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(503)] }) }, [1620]: { 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 }, [1773]: { 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 }, [1783]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1781)] }) }, [1781]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1360), __RΦ.a(1779)] }) }, [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 }, [1779]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1780), p: [__RΦ.a(1)] }) }, [1780]: { 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 }, [1799]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1797)] }) }, [1797]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1804]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1802)] }) }, [1802]: { 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) }] }) }, [1624]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1619)] }) }, [1619]: { LΦ: t => Object }, [1623]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(1619)] }) }, [1657]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1619)] }) }, [1722]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1719)] }) }, [1719]: { LΦ: t => Object }, [1735]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1734)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1734]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1719)] }) }, [
|
|
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 }, [1714]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1717]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(1714), __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Φ: "~" }) }, [1740]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(505)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1749]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(503)] }) }, [1620]: { 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 }, [1773]: { 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 }, [1783]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1781)] }) }, [1781]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(1360), __RΦ.a(1779)] }) }, [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 }, [1779]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1780), p: [__RΦ.a(1)] }) }, [1780]: { 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 }, [1799]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1797)] }) }, [1797]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(602), p: [__RΦ.a(421), __RΦ.a(1)] }) }, [1804]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1802)] }) }, [1802]: { 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) }] }) }, [1624]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1619)] }) }, [1619]: { LΦ: t => Object }, [1623]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(1619)] }) }, [1657]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1619)] }) }, [1722]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1719)] }) }, [1719]: { LΦ: t => Object }, [1735]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1734)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1734]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1719)] }) }, [1880]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1879)] }) }, [1879]: { LΦ: t => Object }, [1883]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1879)] }) }, [1886]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(1885)] }) }, [1885]: { LΦ: t => Object }, [1888]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1889), v: null }], f: "" }) }, [1889]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1885)] }) } } };
|
|
17
17
|
import { reflect } from "typescript-rtti";
|
|
18
18
|
import { MiddlewareChain, resolve } from "../middleware";
|
|
19
19
|
import { getPropertyConversionOptions } from "./property";
|
|
@@ -219,17 +219,19 @@ export class XMLModel {
|
|
|
219
219
|
const parent = getParentModel(this);
|
|
220
220
|
if (parent)
|
|
221
221
|
parent.resolveAllProperties().forEach(__RΦ.f((prop, key) => {
|
|
222
|
-
properties.delete(key); // delete prop if already present
|
|
223
222
|
properties.set(key, prop);
|
|
224
223
|
}, [__RΦ.m("rt:p", [{ n: "prop", 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))], ""));
|
|
225
|
-
this.options.properties.options.forEach(__RΦ.f((options, key) =>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
this.options.properties.options.forEach(__RΦ.f((options, key) => {
|
|
225
|
+
properties.delete(key); // delete prop if already present to make sure it overrides parent's prop
|
|
226
|
+
properties.set(key, new Proxy(options, {
|
|
227
|
+
get: __RΦ.f((target, p, reciever) => {
|
|
228
|
+
if (p === "model")
|
|
229
|
+
return this;
|
|
230
|
+
else
|
|
231
|
+
return Reflect.get(target, p, reciever);
|
|
232
|
+
}, [__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"),
|
|
233
|
+
}));
|
|
234
|
+
}, [__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))], ""));
|
|
233
235
|
return properties;
|
|
234
236
|
}
|
|
235
237
|
}
|
|
@@ -300,18 +302,18 @@ export function getModel(id) {
|
|
|
300
302
|
else
|
|
301
303
|
throw new TypeError(`couln't find model for type ${id.name}`);
|
|
302
304
|
}
|
|
303
|
-
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(
|
|
305
|
+
__RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1880), v: null }])(getModel);
|
|
304
306
|
__RΦ.m("rt:f", "F")(getModel);
|
|
305
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
307
|
+
__RΦ.m("rt:t", () => __RΦ.a(1883))(getModel);
|
|
306
308
|
// Model decorator
|
|
307
309
|
function ModelDecoratorFactory(options) {
|
|
308
310
|
return __RΦ.f(function (constructor) {
|
|
309
311
|
findModel(constructor) || createModel(constructor, options || {});
|
|
310
|
-
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(
|
|
312
|
+
}, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1889), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
|
|
311
313
|
}
|
|
312
|
-
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(
|
|
314
|
+
__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1886), v: null, f: "?" }])(ModelDecoratorFactory);
|
|
313
315
|
__RΦ.m("rt:f", "F")(ModelDecoratorFactory);
|
|
314
|
-
__RΦ.m("rt:t", () => __RΦ.a(
|
|
316
|
+
__RΦ.m("rt:t", () => __RΦ.a(1888))(ModelDecoratorFactory);
|
|
315
317
|
export { ModelDecoratorFactory as Model };
|
|
316
318
|
export { Prop } from "./property";
|
|
317
319
|
import "../defaults/models";
|