xml-model 0.1.0 → 0.1.1

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.
Files changed (53) hide show
  1. package/build/main/defaults/models.js +4 -4
  2. package/build/main/model/index.js +41 -40
  3. package/build/main/model/property.js +20 -20
  4. package/build/main/model/types.js +32 -32
  5. package/build/main/model.spec.js +19 -19
  6. package/build/main/xml.js +4 -4
  7. package/build/module/defaults/index.d.ts +11 -10
  8. package/build/module/defaults/index.js +133 -46
  9. package/build/module/defaults/models.js +37 -6
  10. package/build/module/index.d.ts +2 -1
  11. package/build/module/index.js +1 -0
  12. package/build/module/middleware.js +11 -11
  13. package/build/module/model/index.d.ts +26 -0
  14. package/build/module/model/index.js +295 -0
  15. package/build/module/model/property.d.ts +5 -0
  16. package/build/module/model/property.js +94 -0
  17. package/build/module/model/types.d.ts +69 -0
  18. package/build/module/model/types.js +214 -0
  19. package/build/module/model.spec.js +224 -41
  20. package/build/module/types.d.ts +6 -11
  21. package/build/module/types.js +2 -25
  22. package/build/module/xml.d.ts +20 -4
  23. package/build/module/xml.js +27 -15
  24. package/package.json +9 -6
  25. package/.eslintignore +0 -3
  26. package/.eslintrc.js +0 -6
  27. package/.gitignore +0 -2
  28. package/.vscode/launch.json +0 -21
  29. package/.vscode/settings.json +0 -3
  30. package/build/module/errors.d.ts +0 -3
  31. package/build/module/errors.js +0 -37
  32. package/build/module/model.d.ts +0 -71
  33. package/build/module/model.js +0 -466
  34. package/build/module/xml-from-object.d.ts +0 -11
  35. package/build/module/xml-from-object.js +0 -58
  36. package/build/module/xml-from-object.spec.d.ts +0 -1
  37. package/build/module/xml-from-object.spec.js +0 -104
  38. package/build/module/xml-to-object.d.ts +0 -11
  39. package/build/module/xml-to-object.js +0 -55
  40. package/register-ts-node.js +0 -9
  41. package/src/defaults/index.ts +0 -181
  42. package/src/defaults/models.ts +0 -45
  43. package/src/index.ts +0 -6
  44. package/src/middleware.ts +0 -34
  45. package/src/model/index.ts +0 -245
  46. package/src/model/property.ts +0 -104
  47. package/src/model/types.ts +0 -99
  48. package/src/model.spec.ts +0 -178
  49. package/src/types.ts +0 -8
  50. package/src/xml.ts +0 -80
  51. package/tsconfig.json +0 -106
  52. package/tsconfig.module.json +0 -9
  53. package/yarn.lock +0 -2217
@@ -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Φ: "~" }) }, [1225]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(1223) }] }) }, [1223]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(1044) }) }, [1044]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(1045) }, { n: "name", f: "", t: __RΦ.a(13) }, { n: "attributes", f: "?", t: __RΦ.a(1043) }, { n: "elements", f: "", t: __RΦ.a(1049) }] }) }, [1045]: { LΦ: t => "element" }, [13]: { LΦ: t => String }, [1043]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1042)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1042]: { LΦ: t => require("xml-js/types").IΦAttributes }, [1049]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(166), __RΦ.a(1048)] }) }, [166]: { RΦ: t => ({ TΦ: "O", m: [] }) }, [1048]: { RΦ: t => ({ TΦ: "T", e: [{ t: __RΦ.a(1047) }] }) }, [1047]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(1024) }, { n: "text", f: "", t: __RΦ.a(13) }] }) }, [1024]: { LΦ: t => "text" }, [1246]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(1223) }] }) }, [14]: { LΦ: t => Number }, [1272]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(2988) }] }) }, [2988]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(2986) }) }, [2986]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(13) }, { n: "name", f: "", t: __RΦ.a(13) }] }) }, [20]: { LΦ: t => Boolean } } };
18
+ }, t: { [4]: { RΦ: t => ({ TΦ: "~" }) }, [1244]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(1242) }] }) }, [1242]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(1063) }) }, [1063]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(1064) }, { n: "name", f: "", t: __RΦ.a(13) }, { n: "attributes", f: "?", t: __RΦ.a(1062) }, { n: "elements", f: "", t: __RΦ.a(1068) }] }) }, [1064]: { LΦ: t => "element" }, [13]: { LΦ: t => String }, [1062]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1061)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1061]: { LΦ: t => require("xml-js/types").IΦAttributes }, [1068]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(166), __RΦ.a(1067)] }) }, [166]: { RΦ: t => ({ TΦ: "O", m: [] }) }, [1067]: { RΦ: t => ({ TΦ: "T", e: [{ t: __RΦ.a(1066) }] }) }, [1066]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(1043) }, { n: "text", f: "", t: __RΦ.a(13) }] }) }, [1043]: { LΦ: t => "text" }, [1265]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(1242) }] }) }, [14]: { LΦ: t => Number }, [1291]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(3010) }] }) }, [3010]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(3008) }) }, [3008]: { 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>
@@ -24,7 +24,7 @@ const xml_1 = require("../xml");
24
24
  return {
25
25
  elements: [(0, xml_1.fromContent)(ctx.object, "string")],
26
26
  };
27
- }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1225))], "toXML"),
27
+ }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1244))], "toXML"),
28
28
  fromXML: __RΦ.f((ctx) => {
29
29
  return String((0, xml_1.getContent)(ctx.xml.elements[0]));
30
30
  }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(13))], "fromXML"),
@@ -35,7 +35,7 @@ const xml_1 = require("../xml");
35
35
  return {
36
36
  elements: [(0, xml_1.fromContent)(String(ctx.object), "number")],
37
37
  };
38
- }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1246))], "toXML"),
38
+ }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1265))], "toXML"),
39
39
  fromXML: __RΦ.f((ctx) => {
40
40
  return Number((0, xml_1.getContent)(ctx.xml.elements[0]));
41
41
  }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(14))], "fromXML"),
@@ -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(1272))], "toXML"),
51
+ }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1291))], "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: { [1293]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(500)] }) }, [187]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [500]: { LΦ: t => Object }, [1287]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1290]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(122), p: [__RΦ.a(1287), __RΦ.a(22), __RΦ.a(8)] }) }, [122]: { LΦ: t => Object }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [1291]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1)] }) }, [499]: { TΦ: "5", name: "XMLModel" }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [1319]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1291)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1211]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [13]: { LΦ: t => String }, [1200]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1337]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1186), p: [__RΦ.a(500)] }) }, [1186]: { TΦ: "5", name: "XMLModelConversionOptions" }, [508]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(505), p: [__RΦ.a(500)] }) }, [505]: { LΦ: t => require("./types").IΦXMLModelOptions }, [1400]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1398)] }) }, [1398]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(407), __RΦ.a(1396)] }) }, [514]: { LΦ: t => require("./types").IΦConversionOptions }, [407]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(408), p: [__RΦ.a(406), __RΦ.a(369)] }) }, [408]: { LΦ: t => Object }, [406]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(365), p: [__RΦ.a(1)] }) }, [365]: { LΦ: t => require("./types").IΦfromXMLContext }, [369]: { LΦ: t => "properties" }, [1396]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1397), p: [__RΦ.a(1)] }) }, [1397]: { LΦ: t => Object }, [1351]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1352), p: [__RΦ.a(500)] }) }, [1352]: { LΦ: t => Object }, [1411]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1409)] }) }, [1409]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(666), __RΦ.a(1407)] }) }, [666]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(667), p: [__RΦ.a(665), __RΦ.a(369)] }) }, [667]: { LΦ: t => Object }, [665]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(657), p: [__RΦ.a(1)] }) }, [657]: { LΦ: t => require("./types").IΦtoXMLContext }, [1407]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1408), p: [__RΦ.a(1)] }) }, [1408]: { LΦ: t => Object }, [1377]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1378), p: [__RΦ.a(500)] }) }, [1378]: { LΦ: t => Object }, [20]: { LΦ: t => Boolean }, [1340]: { RΦ: t => ({ TΦ: "O", m: [{ n: "fromXML", f: "", t: __RΦ.a(528) }, { n: "toXML", f: "", t: __RΦ.a(1374) }, { n: "options", f: "", t: __RΦ.a(1348) }] }) }, [528]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(520), __RΦ.a(526)] }) }, [520]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(521), p: [__RΦ.a(518), __RΦ.a(369)] }) }, [521]: { LΦ: t => Object }, [518]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(365), p: [__RΦ.a(506)] }) }, [506]: { LΦ: t => Object }, [526]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(527), p: [__RΦ.a(506)] }) }, [527]: { LΦ: t => Object }, [1374]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(1366), __RΦ.a(1372)] }) }, [1366]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1367), p: [__RΦ.a(1194), __RΦ.a(369)] }) }, [1367]: { LΦ: t => Object }, [1194]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(657), p: [__RΦ.a(506)] }) }, [1372]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1373), p: [__RΦ.a(506)] }) }, [1373]: { LΦ: t => Object }, [1348]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(734), p: [__RΦ.a(1346), __RΦ.a(1347)] }) }, [734]: { LΦ: t => Map }, [1346]: { LΦ: t => Object }, [1347]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(506)] }) }, [199]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [1432]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1430)] }) }, [1430]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(406), __RΦ.a(1)] }) }, [1438]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1436)] }) }, [1436]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(665), __RΦ.a(93)] }) }, [93]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(92) }] }) }, [92]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(91) }) }, [91]: { LΦ: t => require("xml-js/types").IΦElement }, [1486]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(93)] }) }, [28]: { LΦ: t => Object }, [1317]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(694), p: [__RΦ.a(1293)] }) }, [694]: { LΦ: t => require("typescript-rtti/dist").ReflectedClass }, [1190]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1185)] }) }, [1185]: { LΦ: t => Object }, [1189]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1186), p: [__RΦ.a(1185)] }) }, [1230]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1185)] }) }, [1301]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1298)] }) }, [1298]: { LΦ: t => Object }, [1310]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1309)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1309]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1298)] }) }, [1736]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1735)] }) }, [1735]: { LΦ: t => Object }, [1739]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1735)] }) }, [1742]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1186), p: [__RΦ.a(1741)] }) }, [1741]: { LΦ: t => Object }, [1744]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1745), v: null }], f: "" }) }, [1745]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1741)] }) } } };
22
+ }, t: { [1311]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(500)] }) }, [187]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [500]: { LΦ: t => Object }, [1306]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1309]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(122), p: [__RΦ.a(1306), __RΦ.a(22), __RΦ.a(8)] }) }, [122]: { LΦ: t => Object }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [638]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1)] }) }, [499]: { TΦ: "5", name: "XMLModel" }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [1336]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(638)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1230]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [13]: { LΦ: t => String }, [1219]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1354]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1205), p: [__RΦ.a(500)] }) }, [1205]: { TΦ: "5", name: "XMLModelConversionOptions" }, [508]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(505), p: [__RΦ.a(500)] }) }, [505]: { LΦ: t => require("./types").IΦXMLModelOptions }, [1413]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(648)] }) }, [648]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(407), __RΦ.a(646)] }) }, [514]: { LΦ: t => require("./types").IΦConversionOptions }, [407]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(408), p: [__RΦ.a(406), __RΦ.a(369)] }) }, [408]: { LΦ: t => Object }, [406]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(365), p: [__RΦ.a(1)] }) }, [365]: { LΦ: t => require("./types").IΦfromXMLContext }, [369]: { LΦ: t => "properties" }, [646]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(647), p: [__RΦ.a(1)] }) }, [647]: { LΦ: t => Object }, [1368]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1369), p: [__RΦ.a(500)] }) }, [1369]: { LΦ: t => Object }, [1424]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1422)] }) }, [1422]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(682), __RΦ.a(1420)] }) }, [682]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(683), p: [__RΦ.a(681), __RΦ.a(369)] }) }, [683]: { LΦ: t => Object }, [681]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(673), p: [__RΦ.a(1)] }) }, [673]: { LΦ: t => require("./types").IΦtoXMLContext }, [1420]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1421), p: [__RΦ.a(1)] }) }, [1421]: { LΦ: t => Object }, [1394]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1395), p: [__RΦ.a(500)] }) }, [1395]: { LΦ: t => Object }, [20]: { LΦ: t => Boolean }, [1357]: { RΦ: t => ({ TΦ: "O", m: [{ n: "fromXML", f: "", t: __RΦ.a(528) }, { n: "toXML", f: "", t: __RΦ.a(1391) }, { n: "options", f: "", t: __RΦ.a(1365) }] }) }, [528]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(520), __RΦ.a(526)] }) }, [520]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(521), p: [__RΦ.a(518), __RΦ.a(369)] }) }, [521]: { LΦ: t => Object }, [518]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(365), p: [__RΦ.a(506)] }) }, [506]: { LΦ: t => Object }, [526]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(527), p: [__RΦ.a(506)] }) }, [527]: { LΦ: t => Object }, [1391]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(1383), __RΦ.a(1389)] }) }, [1383]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1384), p: [__RΦ.a(1213), __RΦ.a(369)] }) }, [1384]: { LΦ: t => Object }, [1213]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(673), p: [__RΦ.a(506)] }) }, [1389]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1390), p: [__RΦ.a(506)] }) }, [1390]: { LΦ: t => Object }, [1365]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(754), p: [__RΦ.a(1363), __RΦ.a(1364)] }) }, [754]: { LΦ: t => Map }, [1363]: { LΦ: t => Object }, [1364]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(506)] }) }, [199]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [1444]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1442)] }) }, [1442]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(406), __RΦ.a(1)] }) }, [1450]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1448)] }) }, [1448]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(514), p: [__RΦ.a(681), __RΦ.a(93)] }) }, [93]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(92) }] }) }, [92]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(91) }) }, [91]: { LΦ: t => require("xml-js/types").IΦElement }, [1498]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(93)] }) }, [28]: { LΦ: t => Object }, [1334]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(715), p: [__RΦ.a(1311)] }) }, [715]: { LΦ: t => require("typescript-rtti/dist").ReflectedClass }, [1209]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1204)] }) }, [1204]: { LΦ: t => Object }, [1208]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1205), p: [__RΦ.a(1204)] }) }, [1249]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1204)] }) }, [1319]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1316)] }) }, [1316]: { LΦ: t => Object }, [1328]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1327)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1327]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1316)] }) }, [1748]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1747)] }) }, [1747]: { LΦ: t => Object }, [1751]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(499), p: [__RΦ.a(1747)] }) }, [1754]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1205), p: [__RΦ.a(1753)] }) }, [1753]: { LΦ: t => Object }, [1756]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1757), v: null }], f: "" }) }, [1757]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(1753)] }) } } };
23
23
  require("reflect-metadata");
24
24
  const typescript_rtti_1 = require("typescript-rtti");
25
25
  const middleware_1 = require("../middleware");
@@ -41,9 +41,9 @@ function* ParentChain(constructor) {
41
41
  }
42
42
  return;
43
43
  }
44
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1287), v: null }])(ParentChain);
44
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1306), v: null }])(ParentChain);
45
45
  __RΦ.m("rt:f", "F")(ParentChain);
46
- __RΦ.m("rt:t", () => __RΦ.a(1290))(ParentChain);
46
+ __RΦ.m("rt:t", () => __RΦ.a(1309))(ParentChain);
47
47
  function getParentModel(model) {
48
48
  for (const constructor of ParentChain(model.type)) {
49
49
  const model = findModel(constructor);
@@ -53,37 +53,38 @@ function getParentModel(model) {
53
53
  }
54
54
  return null;
55
55
  }
56
- __RΦ.m("rt:p", [{ n: "model", t: () => __RΦ.a(1291), v: null }])(getParentModel);
56
+ __RΦ.m("rt:p", [{ n: "model", t: () => __RΦ.a(638), v: null }])(getParentModel);
57
57
  __RΦ.m("rt:f", "F")(getParentModel);
58
- __RΦ.m("rt:t", () => __RΦ.a(1319))(getParentModel);
58
+ __RΦ.m("rt:t", () => __RΦ.a(1336))(getParentModel);
59
59
  var IΦXMLModelConversionOptions = { name: "XMLModelConversionOptions", prototype: {}, identity: Symbol("XMLModelConversionOptions (interface)") };
60
60
  exports.IΦXMLModelConversionOptions = IΦXMLModelConversionOptions;
61
- (t => __RΦ.t[1186] = t)(IΦXMLModelConversionOptions);
61
+ (t => __RΦ.t[1205] = t)(IΦXMLModelConversionOptions);
62
62
  __RΦ.m("rt:P", ["fromXML", "tagname", "toXML"])(IΦXMLModelConversionOptions);
63
63
  __RΦ.m("rt:m", [])(IΦXMLModelConversionOptions);
64
64
  __RΦ.m("rt:f", "Ie")(IΦXMLModelConversionOptions);
65
- __RΦ.m("rt:t", () => __RΦ.a(1211))(IΦXMLModelConversionOptions.prototype, "fromXML");
65
+ __RΦ.m("rt:t", () => __RΦ.a(1230))(IΦXMLModelConversionOptions.prototype, "fromXML");
66
66
  __RΦ.m("rt:f", "P?")(IΦXMLModelConversionOptions.prototype, "fromXML");
67
67
  __RΦ.m("rt:t", () => __RΦ.a(13))(IΦXMLModelConversionOptions.prototype, "tagname");
68
68
  __RΦ.m("rt:f", "P?")(IΦXMLModelConversionOptions.prototype, "tagname");
69
- __RΦ.m("rt:t", () => __RΦ.a(1200))(IΦXMLModelConversionOptions.prototype, "toXML");
69
+ __RΦ.m("rt:t", () => __RΦ.a(1219))(IΦXMLModelConversionOptions.prototype, "toXML");
70
70
  __RΦ.m("rt:f", "P?")(IΦXMLModelConversionOptions.prototype, "toXML");
71
- __RΦ.m("rt:t", () => __RΦ.a(1211))(IΦXMLModelConversionOptions.prototype, "fromXML");
71
+ __RΦ.m("rt:t", () => __RΦ.a(1230))(IΦXMLModelConversionOptions.prototype, "fromXML");
72
72
  __RΦ.m("rt:f", "P?")(IΦXMLModelConversionOptions.prototype, "fromXML");
73
73
  __RΦ.m("rt:t", () => __RΦ.a(13))(IΦXMLModelConversionOptions.prototype, "tagname");
74
74
  __RΦ.m("rt:f", "P?")(IΦXMLModelConversionOptions.prototype, "tagname");
75
- __RΦ.m("rt:t", () => __RΦ.a(1200))(IΦXMLModelConversionOptions.prototype, "toXML");
75
+ __RΦ.m("rt:t", () => __RΦ.a(1219))(IΦXMLModelConversionOptions.prototype, "toXML");
76
76
  __RΦ.m("rt:f", "P?")(IΦXMLModelConversionOptions.prototype, "toXML");
77
77
  class XMLModel {
78
78
  constructor(type, options) {
79
79
  this.type = type;
80
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
80
81
  const model = this;
81
82
  let parent = undefined;
82
83
  const getParent = __RΦ.f(() => {
83
84
  if (typeof parent === "undefined")
84
85
  parent = getParentModel(this);
85
86
  return parent;
86
- }, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1319))], "getParent");
87
+ }, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1336))], "getParent");
87
88
  let propertiesLoaded = false;
88
89
  const properties = {
89
90
  options: new Map(),
@@ -94,7 +95,6 @@ class XMLModel {
94
95
  },
95
96
  middlewares: [
96
97
  __RΦ.f((context, next) => {
97
- // TODO: typing
98
98
  const record = getParent() ? next() : {};
99
99
  properties.options.forEach(__RΦ.f((property) => {
100
100
  const xml = context.xml;
@@ -111,7 +111,7 @@ class XMLModel {
111
111
  });
112
112
  }, [__RΦ.m("rt:p", [{ n: "property", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
113
113
  return record;
114
- }, [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }, { n: "next", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1351))], ""),
114
+ }, [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }, { n: "next", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1368))], ""),
115
115
  ],
116
116
  },
117
117
  toXML: {
@@ -131,18 +131,19 @@ class XMLModel {
131
131
  });
132
132
  }, [__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
133
133
  return record;
134
- }, [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }, { n: "next", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1377))], ""),
134
+ }, [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }, { n: "next", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1394))], ""),
135
135
  ],
136
136
  },
137
137
  };
138
138
  const loadProperties = __RΦ.f(() => {
139
- const props = (0, typescript_rtti_1.reflect)(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(1293)], r: void 0, tp: [] }).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
139
+ const props = (0, typescript_rtti_1.reflect)(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(1311)], r: void 0, tp: [] }).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
140
140
  props.forEach(__RΦ.f((property) => {
141
141
  const options = (0, property_1.getPropertyConversionOptions)(this.type, property.name);
142
142
  if (!options.ignored) {
143
143
  properties.options.set(property.name, options);
144
144
  }
145
145
  }, [__RΦ.m("rt:p", [{ n: "property", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
146
+ propertiesLoaded = true;
146
147
  }, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
147
148
  this.options = {
148
149
  get properties() {
@@ -169,8 +170,8 @@ class XMLModel {
169
170
  },
170
171
  };
171
172
  if (!getParent()) {
172
- this.options.fromXML.middlewares.push(__RΦ.f((...args) => defaults_1.defaults.fromXML(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1))], ""));
173
- this.options.toXML.middlewares.push(__RΦ.f((...args) => defaults_1.defaults.toXML(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(93))], ""));
173
+ this.options.fromXML.middlewares.push(__RΦ.f((...args) => defaults_1.defaults.fromXML(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null, f: "3" }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1))], ""));
174
+ this.options.toXML.middlewares.push(__RΦ.f((...args) => defaults_1.defaults.toXML(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null, f: "3" }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(93))], ""));
174
175
  }
175
176
  if (options.fromXML)
176
177
  this.options.fromXML.middlewares.push(options.fromXML);
@@ -179,6 +180,7 @@ class XMLModel {
179
180
  }
180
181
  fromXML(xml) {
181
182
  const _xml = typeof xml === "string" ? xml_1.default.parse(xml) : xml;
183
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
182
184
  const model = this;
183
185
  const context = {
184
186
  xml: _xml,
@@ -194,7 +196,7 @@ class XMLModel {
194
196
  return (0, middleware_1.resolve)((0, middleware_1.MiddlewareChain)(this.options.fromXML), context);
195
197
  }
196
198
  toXML(instance) {
197
- // FIXME: typing
199
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
198
200
  const model = this;
199
201
  if (instance instanceof this.type || instance.constructor === this.type) {
200
202
  // intanceof won't work with type "String" for example
@@ -205,8 +207,7 @@ class XMLModel {
205
207
  object: instance,
206
208
  model,
207
209
  };
208
- return (0, middleware_1.resolve)((0, middleware_1.MiddlewareChain)(model.options.properties.toXML), propContext // FIXME: typing
209
- );
210
+ return (0, middleware_1.resolve)((0, middleware_1.MiddlewareChain)(model.options.properties.toXML), propContext);
210
211
  },
211
212
  model: this,
212
213
  };
@@ -217,7 +218,7 @@ class XMLModel {
217
218
  }
218
219
  }
219
220
  get reflectedClass() {
220
- return (0, typescript_rtti_1.reflect)(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(1293)], r: void 0, tp: [] });
221
+ return (0, typescript_rtti_1.reflect)(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(1311)], r: void 0, tp: [] });
221
222
  }
222
223
  }
223
224
  exports.XMLModel = XMLModel;
@@ -226,37 +227,37 @@ __RΦ.m("rt:SP", [])(XMLModel);
226
227
  __RΦ.m("rt:P", ["options", "type", "reflectedClass"])(XMLModel);
227
228
  __RΦ.m("rt:Sm", [])(XMLModel);
228
229
  __RΦ.m("rt:m", ["fromXML", "toXML"])(XMLModel);
229
- __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1293), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1337), v: null }])(XMLModel);
230
+ __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1311), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1354), v: null }])(XMLModel);
230
231
  __RΦ.m("rt:f", "Ce")(XMLModel);
231
232
  __RΦ.m("rt:t", () => __RΦ.a(508))(XMLModel.prototype, "options");
232
233
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "options");
233
- __RΦ.m("rt:t", () => __RΦ.a(1400))(XMLModel.prototype, "parent");
234
+ __RΦ.m("rt:t", () => __RΦ.a(1413))(XMLModel.prototype, "parent");
234
235
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
235
- __RΦ.m("rt:t", () => __RΦ.a(1411))(XMLModel.prototype, "parent");
236
+ __RΦ.m("rt:t", () => __RΦ.a(1424))(XMLModel.prototype, "parent");
236
237
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
237
- __RΦ.m("rt:t", () => __RΦ.a(1340))(XMLModel.prototype, "properties");
238
+ __RΦ.m("rt:t", () => __RΦ.a(1357))(XMLModel.prototype, "properties");
238
239
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
239
- __RΦ.m("rt:t", () => __RΦ.a(1432))(XMLModel.prototype, "parent");
240
+ __RΦ.m("rt:t", () => __RΦ.a(1444))(XMLModel.prototype, "parent");
240
241
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
241
- __RΦ.m("rt:t", () => __RΦ.a(1438))(XMLModel.prototype, "parent");
242
+ __RΦ.m("rt:t", () => __RΦ.a(1450))(XMLModel.prototype, "parent");
242
243
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
243
244
  __RΦ.m("rt:t", () => __RΦ.a(13))(XMLModel.prototype, "tagname");
244
245
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "tagname");
245
246
  __RΦ.m("rt:f", "M.")(XMLModel.prototype["fromXML"]);
246
247
  ((t, p) => __RΦ.m("rt:h", () => typeof t === "object" ? t.constructor : t)(t[p]))(XMLModel.prototype, "fromXML");
247
- __RΦ.m("rt:p", [{ n: "xml", t: () => __RΦ.a(1486), v: null }])(XMLModel.prototype, "fromXML");
248
+ __RΦ.m("rt:p", [{ n: "xml", t: () => __RΦ.a(1498), v: null }])(XMLModel.prototype, "fromXML");
248
249
  __RΦ.m("rt:f", "M.")(XMLModel.prototype, "fromXML");
249
250
  __RΦ.m("rt:t", () => __RΦ.a(500))(XMLModel.prototype, "fromXML");
250
- __RΦ.m("rt:t", () => __RΦ.a(1351))(XMLModel.prototype, "properties");
251
+ __RΦ.m("rt:t", () => __RΦ.a(1368))(XMLModel.prototype, "properties");
251
252
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
252
253
  __RΦ.m("rt:f", "M.")(XMLModel.prototype["toXML"]);
253
254
  ((t, p) => __RΦ.m("rt:h", () => typeof t === "object" ? t.constructor : t)(t[p]))(XMLModel.prototype, "toXML");
254
255
  __RΦ.m("rt:p", [{ n: "instance", t: () => __RΦ.a(28), v: null }])(XMLModel.prototype, "toXML");
255
256
  __RΦ.m("rt:f", "M.")(XMLModel.prototype, "toXML");
256
257
  __RΦ.m("rt:t", () => __RΦ.a(93))(XMLModel.prototype, "toXML");
257
- __RΦ.m("rt:t", () => __RΦ.a(1377))(XMLModel.prototype, "properties");
258
+ __RΦ.m("rt:t", () => __RΦ.a(1394))(XMLModel.prototype, "properties");
258
259
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
259
- __RΦ.m("rt:t", () => __RΦ.a(1317))(XMLModel.prototype, "reflectedClass");
260
+ __RΦ.m("rt:t", () => __RΦ.a(1334))(XMLModel.prototype, "reflectedClass");
260
261
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "reflectedClass");
261
262
  function createModel(type, options) {
262
263
  if (findModel(type)) {
@@ -267,17 +268,17 @@ function createModel(type, options) {
267
268
  return model;
268
269
  }
269
270
  exports.createModel = createModel;
270
- __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1190), v: null }, { n: "options", t: () => __RΦ.a(1189), v: null }])(createModel);
271
+ __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1209), v: null }, { n: "options", t: () => __RΦ.a(1208), v: null }])(createModel);
271
272
  __RΦ.m("rt:f", "F")(createModel);
272
- __RΦ.m("rt:t", () => __RΦ.a(1230))(createModel);
273
+ __RΦ.m("rt:t", () => __RΦ.a(1249))(createModel);
273
274
  exports.Models = new Map();
274
275
  function findModel(id) {
275
276
  return exports.Models.get(id);
276
277
  }
277
278
  exports.findModel = findModel;
278
- __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1301), v: null }])(findModel);
279
+ __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1319), v: null }])(findModel);
279
280
  __RΦ.m("rt:f", "F")(findModel);
280
- __RΦ.m("rt:t", () => __RΦ.a(1310))(findModel);
281
+ __RΦ.m("rt:t", () => __RΦ.a(1328))(findModel);
281
282
  function getModel(id) {
282
283
  const model = findModel(id);
283
284
  if (model)
@@ -286,19 +287,19 @@ function getModel(id) {
286
287
  throw new TypeError(`couln't find model for type ${id.name}`);
287
288
  }
288
289
  exports.getModel = getModel;
289
- __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1736), v: null }])(getModel);
290
+ __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1748), v: null }])(getModel);
290
291
  __RΦ.m("rt:f", "F")(getModel);
291
- __RΦ.m("rt:t", () => __RΦ.a(1739))(getModel);
292
+ __RΦ.m("rt:t", () => __RΦ.a(1751))(getModel);
292
293
  // Model decorator
293
294
  function ModelDecoratorFactory(options) {
294
295
  return __RΦ.f(function (constructor) {
295
296
  findModel(constructor) || createModel(constructor, options || {});
296
- }, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1745), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
297
+ }, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1757), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
297
298
  }
298
299
  exports.Model = ModelDecoratorFactory;
299
- __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1742), v: null, f: "?" }])(ModelDecoratorFactory);
300
+ __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1754), v: null, f: "?" }])(ModelDecoratorFactory);
300
301
  __RΦ.m("rt:f", "F")(ModelDecoratorFactory);
301
- __RΦ.m("rt:t", () => __RΦ.a(1744))(ModelDecoratorFactory);
302
+ __RΦ.m("rt:t", () => __RΦ.a(1756))(ModelDecoratorFactory);
302
303
  var property_2 = require("./property");
303
304
  Object.defineProperty(exports, "Prop", { enumerable: true, get: function () { return property_2.Prop; } });
304
305
  require("../defaults/models");
@@ -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: { [190]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(182)] }) }, [187]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [182]: { LΦ: t => Object }, [186]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(183), p: [__RΦ.a(182)] }) }, [183]: { LΦ: t => require("./types").IΦCreateXMLModelPropertyOptions }, [198]: { LΦ: t => Object }, [202]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(182)] }) }, [199]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [482]: { LΦ: t => require("typescript-rtti/dist").ReflectedProperty }, [13]: { LΦ: t => String }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [20]: { LΦ: t => Boolean }, [92]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(91) }) }, [91]: { LΦ: t => require("xml-js/types").IΦElement }, [622]: { LΦ: t => Object }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [93]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(92) }] }) }, [742]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(741)] }) }, [741]: { LΦ: t => Object }, [744]: { LΦ: t => Object }, [745]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(741)] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [907]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(906)] }) }, [906]: { LΦ: t => Object }, [909]: { LΦ: t => Object }, [918]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(910)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [910]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(906)] }) }, [924]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(923)] }) }, [923]: { LΦ: t => Object }, [926]: { LΦ: t => Object }, [950]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(923)] }) }, [957]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(183), p: [__RΦ.a(956)] }) }, [956]: { LΦ: t => Object }, [959]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(961), v: null }], f: "" }) }, [961]: { LΦ: t => Object } } };
19
+ }, t: { [190]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(182)] }) }, [187]: { LΦ: t => require("typescript-rtti/dist").IΦConstructor }, [182]: { LΦ: t => Object }, [186]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(183), p: [__RΦ.a(182)] }) }, [183]: { LΦ: t => require("./types").IΦCreateXMLModelPropertyOptions }, [198]: { LΦ: t => Object }, [202]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(182)] }) }, [199]: { LΦ: t => require("./types").IΦXMLModelPropertyOptions }, [482]: { LΦ: t => require("typescript-rtti/dist").ReflectedProperty }, [13]: { LΦ: t => String }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [20]: { LΦ: t => Boolean }, [92]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(91) }) }, [91]: { LΦ: t => require("xml-js/types").IΦElement }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [93]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(92) }] }) }, [762]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(761)] }) }, [761]: { LΦ: t => Object }, [764]: { LΦ: t => Object }, [765]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(761)] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [926]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(925)] }) }, [925]: { LΦ: t => Object }, [928]: { LΦ: t => Object }, [937]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(929)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [929]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(925)] }) }, [943]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(187), p: [__RΦ.a(942)] }) }, [942]: { LΦ: t => Object }, [945]: { LΦ: t => Object }, [969]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(199), p: [__RΦ.a(942)] }) }, [976]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(183), p: [__RΦ.a(975)] }) }, [975]: { LΦ: t => Object }, [978]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(980), v: null }], f: "" }) }, [980]: { 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) {
@@ -30,14 +30,12 @@ function resolvePropertyConversionOptions(options, constructor, property) {
30
30
  },
31
31
  inline: !!options.inline,
32
32
  ignored: !!options.ignore,
33
- isSourceElement: __RΦ.f((...args) => defaults_1.defaults.propertySourceElementsFilter(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(20))], "isSourceElement"),
33
+ isSourceElement: __RΦ.f((...args) => defaults_1.defaults.propertySourceElementsFilter(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null, f: "3" }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(20))], "isSourceElement"),
34
34
  resolveElements: options.resolveElements
35
35
  ? options.resolveElements
36
- : __RΦ.f((...args) => defaults_1.defaults.propertyResolveSourceElements(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(92))], ""),
37
- fromXML: options.fromXML
38
- ? __RΦ.f((context) => options.fromXML(context), [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(622))], "") : __RΦ.f((context) => defaults_1.defaults.propertyFromXML(context), [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1))], ""),
39
- toXML: options.toXML
40
- ? __RΦ.f((context) => options.toXML(context), [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(93))], "") : __RΦ.f((context) => defaults_1.defaults.propertyToXML(context), [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(93))], ""),
36
+ : __RΦ.f((...args) => defaults_1.defaults.propertyResolveSourceElements(...args), [__RΦ.m("rt:p", [{ n: "args", t: () => __RΦ.a(4), v: null, f: "3" }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(92))], ""),
37
+ fromXML: __RΦ.f((context) => (options.fromXML || defaults_1.defaults.propertyFromXML)(context), [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1))], "fromXML"),
38
+ toXML: __RΦ.f((context) => (options.toXML || defaults_1.defaults.propertyToXML)(context), [__RΦ.m("rt:p", [{ n: "context", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(93))], "toXML"),
41
39
  };
42
40
  if (options === null || options === void 0 ? void 0 : options.sourceElements) {
43
41
  const _sourceElements = options.sourceElements;
@@ -58,12 +56,14 @@ __RΦ.m("rt:f", "F")(resolvePropertyConversionOptions);
58
56
  __RΦ.m("rt:t", () => __RΦ.a(202))(resolvePropertyConversionOptions);
59
57
  const PropertyOptions = new Map();
60
58
  function storePropertyConversionOptions(constructor, property, options) {
61
- if (!PropertyOptions.has(constructor))
62
- PropertyOptions.set(constructor, new Map());
63
- PropertyOptions.get(constructor).set(property, // FIXME
64
- options);
59
+ let map = PropertyOptions.get(constructor);
60
+ if (!map) {
61
+ map = new Map();
62
+ PropertyOptions.set(constructor, map);
63
+ }
64
+ map.set(property, options);
65
65
  }
66
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(742), v: null }, { n: "property", t: () => __RΦ.a(744), v: null }, { n: "options", t: () => __RΦ.a(745), v: null }])(storePropertyConversionOptions);
66
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(762), v: null }, { n: "property", t: () => __RΦ.a(764), v: null }, { n: "options", t: () => __RΦ.a(765), v: null }])(storePropertyConversionOptions);
67
67
  __RΦ.m("rt:f", "F")(storePropertyConversionOptions);
68
68
  __RΦ.m("rt:t", () => __RΦ.a(22))(storePropertyConversionOptions);
69
69
  function findPropertyConversionOptions(constructor, property) {
@@ -72,24 +72,24 @@ function findPropertyConversionOptions(constructor, property) {
72
72
  return options.get(property);
73
73
  }
74
74
  }
75
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(907), v: null }, { n: "property", t: () => __RΦ.a(909), v: null }])(findPropertyConversionOptions);
75
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(926), v: null }, { n: "property", t: () => __RΦ.a(928), v: null }])(findPropertyConversionOptions);
76
76
  __RΦ.m("rt:f", "F")(findPropertyConversionOptions);
77
- __RΦ.m("rt:t", () => __RΦ.a(918))(findPropertyConversionOptions);
77
+ __RΦ.m("rt:t", () => __RΦ.a(937))(findPropertyConversionOptions);
78
78
  function getPropertyConversionOptions(constructor, property) {
79
79
  const options = findPropertyConversionOptions(constructor, property);
80
80
  return options || resolvePropertyConversionOptions({}, constructor, property);
81
81
  }
82
82
  exports.getPropertyConversionOptions = getPropertyConversionOptions;
83
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(924), v: null }, { n: "property", t: () => __RΦ.a(926), v: null }])(getPropertyConversionOptions);
83
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(943), v: null }, { n: "property", t: () => __RΦ.a(945), v: null }])(getPropertyConversionOptions);
84
84
  __RΦ.m("rt:f", "F")(getPropertyConversionOptions);
85
- __RΦ.m("rt:t", () => __RΦ.a(950))(getPropertyConversionOptions);
85
+ __RΦ.m("rt:t", () => __RΦ.a(969))(getPropertyConversionOptions);
86
86
  function PropDecoratorFactory(options) {
87
- return __RΦ.f(function (prototype /* FIXME: should be typed */, property) {
87
+ return __RΦ.f(function (prototype, property) {
88
88
  const _options = resolvePropertyConversionOptions(options || {}, prototype.constructor, property);
89
89
  storePropertyConversionOptions(prototype.constructor, property, _options);
90
- }, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(961), v: null }]), __RΦ.m("rt:f", "M."), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
90
+ }, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(980), v: null }]), __RΦ.m("rt:f", "M."), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
91
91
  }
92
92
  exports.Prop = PropDecoratorFactory;
93
- __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(957), v: null, f: "?" }])(PropDecoratorFactory);
93
+ __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(976), v: null, f: "?" }])(PropDecoratorFactory);
94
94
  __RΦ.m("rt:f", "F")(PropDecoratorFactory);
95
- __RΦ.m("rt:t", () => __RΦ.a(959))(PropDecoratorFactory);
95
+ __RΦ.m("rt:t", () => __RΦ.a(978))(PropDecoratorFactory);