xml-model 0.2.0 → 0.2.3

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.
@@ -13,17 +13,17 @@ 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Φ: "~" }) }, [103]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(102) }] }) }, [102]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(101) }) }, [101]: { LΦ: t => LΦ_0.IΦElement }, [13]: { LΦ: t => String }, [14]: { LΦ: t => Number }, [1718]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(3141) }] }) }, [3141]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(3139) }) }, [3139]: { RΦ: t => ({ TΦ: "O", m: [{ n: "type", f: "", t: __RΦ.a(13) }, { n: "name", f: "", t: __RΦ.a(13) }] }) }, [20]: { LΦ: t => Boolean } } };
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 }, [1696]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(3123) }] }) }, [3123]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(3121) }) }, [3121]: { 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
- import * as LΦ_0 from "xml-js/types";
19
+ import * as LΦ_0 from "../types";
20
20
  // string is <string>value</string>
21
21
  createModel(String, {
22
22
  toXML: __RΦ.f((ctx) => {
23
23
  return {
24
24
  elements: [fromContent(ctx.object, "string")],
25
25
  };
26
- }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(103))], "toXML"),
26
+ }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(111))], "toXML"),
27
27
  fromXML: __RΦ.f((ctx) => {
28
28
  return String(getContent(ctx.xml.elements[0]));
29
29
  }, [__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"),
@@ -34,7 +34,7 @@ createModel(Number, {
34
34
  return {
35
35
  elements: [fromContent(String(ctx.object), "number")],
36
36
  };
37
- }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(103))], "toXML"),
37
+ }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(111))], "toXML"),
38
38
  fromXML: __RΦ.f((ctx) => {
39
39
  return Number(getContent(ctx.xml.elements[0]));
40
40
  }, [__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"),
@@ -44,14 +44,10 @@ createModel(Boolean, {
44
44
  toXML: __RΦ.f((ctx) => {
45
45
  return {
46
46
  elements: [
47
- {
48
- type: "element",
49
- name: "boolean",
50
- ...fromContent(String(ctx.object)),
51
- },
47
+ Object.assign({ type: "element", name: "boolean" }, fromContent(String(ctx.object))),
52
48
  ],
53
49
  };
54
- }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1718))], "toXML"),
50
+ }, [__RΦ.m("rt:p", [{ n: "ctx", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1696))], "toXML"),
55
51
  fromXML: __RΦ.f((ctx) => {
56
52
  return Boolean(getContent(ctx.xml.elements[0]));
57
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"),
@@ -15,9 +15,9 @@ const __RΦ = { m: (k, v) => (t, ...a) => t && Reflect.metadata ? Reflect.metada
15
15
  return t;
16
16
  }, t: { [13]: { LΦ: t => String }, [8]: { RΦ: t => ({ TΦ: "U" }) } } };
17
17
  export class XMLConversionError extends Error {
18
- origin;
19
18
  constructor(message, origin) {
20
19
  super(message);
20
+ this.name = "XMLConversionError";
21
21
  this.origin = origin;
22
22
  }
23
23
  }
@@ -13,19 +13,19 @@ 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: { [112]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(109)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [109]: { TΦ: "5", name: "ChainableOptions" }, [115]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(114) }) }, [114]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [118]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(109), p: [__RΦ.a(116), __RΦ.a(117)] }) }, [116]: { LΦ: t => Object }, [117]: { LΦ: t => Object }, [137]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(132), p: [__RΦ.a(119), __RΦ.a(22), __RΦ.a(8)] }) }, [132]: { LΦ: t => Object }, [119]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [149]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(141), p: [__RΦ.a(152), __RΦ.a(1), __RΦ.a(10)] }) }, [141]: { LΦ: t => Object }, [152]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [147]: { LΦ: t => Object }, [148]: { LΦ: t => Object } } };
16
+ }, t: { [120]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(117)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [117]: { TΦ: "5", name: "ChainableOptions" }, [123]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(122) }) }, [122]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [126]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(117), p: [__RΦ.a(124), __RΦ.a(125)] }) }, [124]: { LΦ: t => Object }, [125]: { LΦ: t => Object }, [145]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(140), p: [__RΦ.a(127), __RΦ.a(22), __RΦ.a(8)] }) }, [140]: { LΦ: t => Object }, [127]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [157]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(149), p: [__RΦ.a(160), __RΦ.a(1), __RΦ.a(10)] }) }, [149]: { LΦ: t => Object }, [160]: { RΦ: t => ({ TΦ: "O", m: [{ n: "__call", f: "", t: __RΦ.a(4) }] }) }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [155]: { LΦ: t => Object }, [156]: { LΦ: t => Object } } };
17
17
  var IΦChainableOptions = { name: "ChainableOptions", prototype: {}, identity: Symbol("ChainableOptions (interface)") };
18
- (t => __RΦ.t[109] = t)(IΦChainableOptions);
18
+ (t => __RΦ.t[117] = t)(IΦChainableOptions);
19
19
  __RΦ.m("rt:P", ["parent", "middlewares"])(IΦChainableOptions);
20
20
  __RΦ.m("rt:m", [])(IΦChainableOptions);
21
21
  __RΦ.m("rt:f", "I")(IΦChainableOptions);
22
- __RΦ.m("rt:t", () => __RΦ.a(112))(IΦChainableOptions.prototype, "parent");
22
+ __RΦ.m("rt:t", () => __RΦ.a(120))(IΦChainableOptions.prototype, "parent");
23
23
  __RΦ.m("rt:f", "P")(IΦChainableOptions.prototype, "parent");
24
- __RΦ.m("rt:t", () => __RΦ.a(115))(IΦChainableOptions.prototype, "middlewares");
24
+ __RΦ.m("rt:t", () => __RΦ.a(123))(IΦChainableOptions.prototype, "middlewares");
25
25
  __RΦ.m("rt:f", "P")(IΦChainableOptions.prototype, "middlewares");
26
- __RΦ.m("rt:t", () => __RΦ.a(112))(IΦChainableOptions.prototype, "parent");
26
+ __RΦ.m("rt:t", () => __RΦ.a(120))(IΦChainableOptions.prototype, "parent");
27
27
  __RΦ.m("rt:f", "P")(IΦChainableOptions.prototype, "parent");
28
- __RΦ.m("rt:t", () => __RΦ.a(115))(IΦChainableOptions.prototype, "middlewares");
28
+ __RΦ.m("rt:t", () => __RΦ.a(123))(IΦChainableOptions.prototype, "middlewares");
29
29
  __RΦ.m("rt:f", "P")(IΦChainableOptions.prototype, "middlewares");
30
30
  export function* MiddlewareChain(options) {
31
31
  do {
@@ -38,9 +38,9 @@ export function* MiddlewareChain(options) {
38
38
  return;
39
39
  } while (true);
40
40
  }
41
- __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(118), v: null }])(MiddlewareChain);
41
+ __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(126), v: null }])(MiddlewareChain);
42
42
  __RΦ.m("rt:f", "F")(MiddlewareChain);
43
- __RΦ.m("rt:t", () => __RΦ.a(137))(MiddlewareChain);
43
+ __RΦ.m("rt:t", () => __RΦ.a(145))(MiddlewareChain);
44
44
  export function resolve(middlewares, context) {
45
45
  const next = __RΦ.f(() => {
46
46
  const { value: nextMiddleware, done } = middlewares.next();
@@ -52,9 +52,9 @@ export function resolve(middlewares, context) {
52
52
  else {
53
53
  return nextMiddleware(context, next);
54
54
  }
55
- }, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(148))], "next");
55
+ }, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(156))], "next");
56
56
  return next();
57
57
  }
58
- __RΦ.m("rt:p", [{ n: "middlewares", t: () => __RΦ.a(149), v: null }, { n: "context", t: () => __RΦ.a(147), v: null }])(resolve);
58
+ __RΦ.m("rt:p", [{ n: "middlewares", t: () => __RΦ.a(157), v: null }, { n: "context", t: () => __RΦ.a(155), v: null }])(resolve);
59
59
  __RΦ.m("rt:f", "F")(resolve);
60
- __RΦ.m("rt:t", () => __RΦ.a(148))(resolve);
60
+ __RΦ.m("rt:t", () => __RΦ.a(156))(resolve);
@@ -1,4 +1,3 @@
1
- import "reflect-metadata";
2
1
  import type { Constructor } from "typescript-rtti";
3
2
  import { XMLModelOptions, XMLModelPropertyOptions, CreateXMLModelOptions } from "./types";
4
3
  import { XMLRoot } from "../types";
@@ -13,8 +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: { [527]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(498)] }) }, [194]: { LΦ: t => LΦ_0.IΦConstructor }, [498]: { LΦ: t => Object }, [1736]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(8)] }) }, [8]: { RΦ: t => ({ TΦ: "U" }) }, [1739]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(132), p: [__RΦ.a(1736), __RΦ.a(22), __RΦ.a(8)] }) }, [132]: { LΦ: t => Object }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [500]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(497), p: [__RΦ.a(1)] }) }, [497]: { TΦ: "5", name: "XMLModel" }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [1762]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(500)] }) }, [12]: { RΦ: t => ({ TΦ: "n" }) }, [1771]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1642), p: [__RΦ.a(498)] }) }, [1642]: { LΦ: t => LΦ_1.IΦCreateXMLModelOptions }, [520]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(517), p: [__RΦ.a(498)] }) }, [517]: { LΦ: t => LΦ_1.IΦXMLModelOptions }, [1795]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1317)] }) }, [1317]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(597), p: [__RΦ.a(417), __RΦ.a(1315)] }) }, [597]: { LΦ: t => LΦ_1.IΦConversionOptions }, [417]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(418), p: [__RΦ.a(416), __RΦ.a(379)] }) }, [418]: { LΦ: t => Object }, [416]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(375), p: [__RΦ.a(1)] }) }, [375]: { LΦ: t => LΦ_1.IΦfromXMLContext }, [379]: { LΦ: t => "properties" }, [1315]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1316), p: [__RΦ.a(1)] }) }, [1316]: { LΦ: t => Object }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [646]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(647), p: [__RΦ.a(498)] }) }, [647]: { LΦ: t => Object }, [1805]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1803)] }) }, [1803]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(597), p: [__RΦ.a(1349), __RΦ.a(1801)] }) }, [1349]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1350), p: [__RΦ.a(1348), __RΦ.a(379)] }) }, [1350]: { LΦ: t => Object }, [1348]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(849), p: [__RΦ.a(1)] }) }, [849]: { LΦ: t => LΦ_1.IΦtoXMLContext }, [1801]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(1802), p: [__RΦ.a(1)] }) }, [1802]: { LΦ: t => Object }, [879]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(880), p: [__RΦ.a(498)] }) }, [880]: { LΦ: t => Object }, [20]: { LΦ: t => Boolean }, [649]: { RΦ: t => ({ TΦ: "O", m: [{ n: "fromXML", f: "", t: __RΦ.a(655) }, { n: "toXML", f: "", t: __RΦ.a(887) }, { n: "options", f: "", t: __RΦ.a(1063) }] }) }, [655]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(597), p: [__RΦ.a(651), __RΦ.a(653)] }) }, [651]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(652), p: [__RΦ.a(601), __RΦ.a(379)] }) }, [652]: { LΦ: t => Object }, [601]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(375), p: [__RΦ.a(518)] }) }, [518]: { LΦ: t => Object }, [653]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(654), p: [__RΦ.a(518)] }) }, [654]: { LΦ: t => Object }, [887]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(597), p: [__RΦ.a(883), __RΦ.a(885)] }) }, [883]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(884), p: [__RΦ.a(852), __RΦ.a(379)] }) }, [884]: { LΦ: t => Object }, [852]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(849), p: [__RΦ.a(518)] }) }, [885]: { RΦ: t => ({ TΦ: "m", t: __RΦ.a(886), p: [__RΦ.a(518)] }) }, [886]: { LΦ: t => Object }, [1063]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1053), p: [__RΦ.a(1061), __RΦ.a(1062)] }) }, [1053]: { LΦ: t => Map }, [1061]: { LΦ: t => Object }, [1062]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(206), p: [__RΦ.a(518)] }) }, [206]: { LΦ: t => LΦ_1.IΦXMLModelPropertyOptions }, [1821]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1819)] }) }, [1819]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(597), p: [__RΦ.a(416), __RΦ.a(1)] }) }, [1826]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(12), __RΦ.a(1824)] }) }, [1824]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(597), p: [__RΦ.a(1348), __RΦ.a(103)] }) }, [103]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(102) }] }) }, [102]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(101) }) }, [101]: { LΦ: t => LΦ_2.IΦElement }, [13]: { LΦ: t => String }, [536]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(13), __RΦ.a(103)] }) }, [28]: { LΦ: t => Object }, [937]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(933), p: [__RΦ.a(527)] }) }, [933]: { LΦ: t => LΦ_0.ReflectedClass }, [1058]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1053), p: [__RΦ.a(13), __RΦ.a(1052)] }) }, [1052]: { RΦ: t => ({ TΦ: "&", t: [__RΦ.a(1050), __RΦ.a(1051)] }) }, [1050]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(206), p: [__RΦ.a(1)] }) }, [1051]: { RΦ: t => ({ TΦ: "O", m: [{ n: "model", f: "", t: __RΦ.a(1) }] }) }, [1646]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(1641)] }) }, [1641]: { LΦ: t => Object }, [1645]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1642), p: [__RΦ.a(1641)] }) }, [1679]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(497), p: [__RΦ.a(1641)] }) }, [1744]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(1741)] }) }, [1741]: { LΦ: t => Object }, [1757]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1756)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1756]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(497), p: [__RΦ.a(1741)] }) }, [1958]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(1957)] }) }, [1957]: { LΦ: t => Object }, [1961]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(497), p: [__RΦ.a(1957)] }) }, [1964]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1642), p: [__RΦ.a(1963)] }) }, [1963]: { LΦ: t => Object }, [1966]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1967), v: null }], f: "" }) }, [1967]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(1963)] }) } } };
17
- import "reflect-metadata";
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)] }) }, [1936]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1935)] }) }, [1935]: { LΦ: t => Object }, [1939]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(502), p: [__RΦ.a(1935)] }) }, [1942]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(1620), p: [__RΦ.a(1941)] }) }, [1941]: { LΦ: t => Object }, [1944]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "constructor", t: () => __RΦ.a(1945), v: null }], f: "" }) }, [1945]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1941)] }) } } };
18
17
  import { reflect } from "typescript-rtti";
19
18
  import { MiddlewareChain, resolve } from "../middleware";
20
19
  import { getPropertyConversionOptions } from "./property";
@@ -35,11 +34,11 @@ function* ParentChain(constructor) {
35
34
  }
36
35
  return;
37
36
  }
38
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1736), v: null }])(ParentChain);
37
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1714), v: null }])(ParentChain);
39
38
  __RΦ.m("rt:f", "F")(ParentChain);
40
- __RΦ.m("rt:t", () => __RΦ.a(1739))(ParentChain);
39
+ __RΦ.m("rt:t", () => __RΦ.a(1717))(ParentChain);
41
40
  import * as LΦ_1 from "./types";
42
- import * as LΦ_2 from "xml-js/types";
41
+ import * as LΦ_2 from "../types";
43
42
  function getParentModel(model) {
44
43
  if (model.options.parent)
45
44
  return model.options.parent;
@@ -51,13 +50,11 @@ function getParentModel(model) {
51
50
  }
52
51
  return null;
53
52
  }
54
- __RΦ.m("rt:p", [{ n: "model", t: () => __RΦ.a(500), v: null }])(getParentModel);
53
+ __RΦ.m("rt:p", [{ n: "model", t: () => __RΦ.a(505), v: null }])(getParentModel);
55
54
  __RΦ.m("rt:f", "F")(getParentModel);
56
- __RΦ.m("rt:t", () => __RΦ.a(1762))(getParentModel);
55
+ __RΦ.m("rt:t", () => __RΦ.a(1740))(getParentModel);
57
56
  import * as LΦ_0 from "typescript-rtti/dist";
58
57
  export class XMLModel {
59
- type;
60
- options;
61
58
  constructor(type, options) {
62
59
  this.type = type;
63
60
  // eslint-disable-next-line @typescript-eslint/no-this-alias
@@ -67,13 +64,14 @@ export class XMLModel {
67
64
  if (typeof parent === "undefined")
68
65
  parent = getParentModel(this);
69
66
  return parent;
70
- }, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1762))], "getParent");
67
+ }, [__RΦ.m("rt:p", []), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1740))], "getParent");
71
68
  let propertiesLoaded = false;
72
69
  const properties = {
73
70
  options: new Map(),
74
71
  fromXML: {
75
72
  get parent() {
76
- return getParent()?.options.properties.fromXML || null;
73
+ var _a;
74
+ return ((_a = getParent()) === null || _a === void 0 ? void 0 : _a.options.properties.fromXML) || null;
77
75
  },
78
76
  middlewares: [
79
77
  __RΦ.f((context, next) => {
@@ -98,12 +96,13 @@ export class XMLModel {
98
96
  }
99
97
  }, [__RΦ.m("rt:p", [{ n: "property", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
100
98
  return record;
101
- }, [__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(646))], ""),
99
+ }, [__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(658))], ""),
102
100
  ],
103
101
  },
104
102
  toXML: {
105
103
  get parent() {
106
- return getParent()?.options.properties.toXML || null;
104
+ var _a;
105
+ return ((_a = getParent()) === null || _a === void 0 ? void 0 : _a.options.properties.toXML) || null;
107
106
  },
108
107
  middlewares: [
109
108
  __RΦ.f((context, next) => {
@@ -122,12 +121,12 @@ export class XMLModel {
122
121
  }
123
122
  }, [__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(22))], ""));
124
123
  return record;
125
- }, [__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(879))], ""),
124
+ }, [__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(890))], ""),
126
125
  ],
127
126
  },
128
127
  };
129
128
  const loadProperties = __RΦ.f(() => {
130
- const props = reflect(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(527)], 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
129
+ const props = reflect(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(532)], 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
131
130
  props.forEach(__RΦ.f((property) => {
132
131
  const options = getPropertyConversionOptions(this.type, property.name);
133
132
  if (!options.ignored) {
@@ -145,13 +144,15 @@ export class XMLModel {
145
144
  fromXML: {
146
145
  middlewares: [],
147
146
  get parent() {
148
- return getParent()?.options.fromXML || null;
147
+ var _a;
148
+ return ((_a = getParent()) === null || _a === void 0 ? void 0 : _a.options.fromXML) || null;
149
149
  },
150
150
  },
151
151
  toXML: {
152
152
  middlewares: [],
153
153
  get parent() {
154
- return getParent()?.options.toXML || null;
154
+ var _a;
155
+ return ((_a = getParent()) === null || _a === void 0 ? void 0 : _a.options.toXML) || null;
155
156
  },
156
157
  },
157
158
  get tagname() {
@@ -162,7 +163,7 @@ export class XMLModel {
162
163
  this.options.parent = options.parent;
163
164
  if (!getParent()) {
164
165
  this.options.fromXML.middlewares.push(__RΦ.f((...args) => 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))], ""));
165
- this.options.toXML.middlewares.push(__RΦ.f((...args) => 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(103))], ""));
166
+ this.options.toXML.middlewares.push(__RΦ.f((...args) => 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(111))], ""));
166
167
  }
167
168
  if (options.fromXML)
168
169
  this.options.fromXML.middlewares.push(options.fromXML);
@@ -211,7 +212,7 @@ export class XMLModel {
211
212
  }
212
213
  }
213
214
  get reflectedClass() {
214
- return reflect(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(527)], r: void 0, tp: [] });
215
+ return reflect(this.type, { TΦ: "c", t: void 0, p: [__RΦ.a(532)], r: void 0, tp: [] });
215
216
  }
216
217
  resolveAllProperties() {
217
218
  const properties = new Map();
@@ -219,7 +220,7 @@ export class XMLModel {
219
220
  if (parent)
220
221
  parent
221
222
  .resolveAllProperties()
222
- .forEach(__RΦ.f((prop, key) => properties.set(key, prop), [__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(1058))], ""));
223
+ .forEach(__RΦ.f((prop, key) => properties.set(key, prop), [__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(1069))], ""));
223
224
  this.options.properties.options.forEach(__RΦ.f((options, key) => properties.set(key, new Proxy(options, {
224
225
  get: __RΦ.f((target, p, reciever) => {
225
226
  if (p === "model")
@@ -227,52 +228,52 @@ export class XMLModel {
227
228
  else
228
229
  return Reflect.get(target, p, reciever);
229
230
  }, [__RΦ.m("rt:p", [{ n: "target", t: () => __RΦ.a(4), v: null }, { n: "p", t: () => __RΦ.a(4), v: null }, { n: "reciever", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1))], "get"),
230
- })), [__RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(4), v: null }, { n: "key", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(1058))], ""));
231
+ })), [__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(1069))], ""));
231
232
  return properties;
232
233
  }
233
234
  }
234
- (t => __RΦ.t[497] = t)(XMLModel);
235
+ (t => __RΦ.t[502] = t)(XMLModel);
235
236
  __RΦ.m("rt:SP", [])(XMLModel);
236
237
  __RΦ.m("rt:P", ["options", "type", "reflectedClass"])(XMLModel);
237
238
  __RΦ.m("rt:Sm", [])(XMLModel);
238
239
  __RΦ.m("rt:m", ["fromXML", "toXML", "resolveAllProperties"])(XMLModel);
239
- __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(527), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1771), v: null }])(XMLModel);
240
+ __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(532), v: null, f: "R" }, { n: "options", t: () => __RΦ.a(1749), v: null }])(XMLModel);
240
241
  __RΦ.m("rt:f", "Ce")(XMLModel);
241
- __RΦ.m("rt:t", () => __RΦ.a(520))(XMLModel.prototype, "options");
242
+ __RΦ.m("rt:t", () => __RΦ.a(525))(XMLModel.prototype, "options");
242
243
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "options");
243
- __RΦ.m("rt:t", () => __RΦ.a(1795))(XMLModel.prototype, "parent");
244
+ __RΦ.m("rt:t", () => __RΦ.a(1773))(XMLModel.prototype, "parent");
244
245
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
245
- __RΦ.m("rt:t", () => __RΦ.a(1805))(XMLModel.prototype, "parent");
246
+ __RΦ.m("rt:t", () => __RΦ.a(1783))(XMLModel.prototype, "parent");
246
247
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
247
- __RΦ.m("rt:t", () => __RΦ.a(649))(XMLModel.prototype, "properties");
248
+ __RΦ.m("rt:t", () => __RΦ.a(661))(XMLModel.prototype, "properties");
248
249
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
249
- __RΦ.m("rt:t", () => __RΦ.a(1821))(XMLModel.prototype, "parent");
250
+ __RΦ.m("rt:t", () => __RΦ.a(1799))(XMLModel.prototype, "parent");
250
251
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
251
- __RΦ.m("rt:t", () => __RΦ.a(1826))(XMLModel.prototype, "parent");
252
+ __RΦ.m("rt:t", () => __RΦ.a(1804))(XMLModel.prototype, "parent");
252
253
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "parent");
253
254
  __RΦ.m("rt:t", () => __RΦ.a(13))(XMLModel.prototype, "tagname");
254
255
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "tagname");
255
256
  __RΦ.m("rt:f", "M.")(XMLModel.prototype["fromXML"]);
256
257
  ((t, p) => __RΦ.m("rt:h", () => typeof t === "object" ? t.constructor : t)(t[p]))(XMLModel.prototype, "fromXML");
257
- __RΦ.m("rt:p", [{ n: "xml", t: () => __RΦ.a(536), v: null }])(XMLModel.prototype, "fromXML");
258
+ __RΦ.m("rt:p", [{ n: "xml", t: () => __RΦ.a(541), v: null }])(XMLModel.prototype, "fromXML");
258
259
  __RΦ.m("rt:f", "M.")(XMLModel.prototype, "fromXML");
259
- __RΦ.m("rt:t", () => __RΦ.a(498))(XMLModel.prototype, "fromXML");
260
- __RΦ.m("rt:t", () => __RΦ.a(646))(XMLModel.prototype, "properties");
260
+ __RΦ.m("rt:t", () => __RΦ.a(503))(XMLModel.prototype, "fromXML");
261
+ __RΦ.m("rt:t", () => __RΦ.a(658))(XMLModel.prototype, "properties");
261
262
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
262
263
  __RΦ.m("rt:f", "M.")(XMLModel.prototype["toXML"]);
263
264
  ((t, p) => __RΦ.m("rt:h", () => typeof t === "object" ? t.constructor : t)(t[p]))(XMLModel.prototype, "toXML");
264
265
  __RΦ.m("rt:p", [{ n: "instance", t: () => __RΦ.a(28), v: null }])(XMLModel.prototype, "toXML");
265
266
  __RΦ.m("rt:f", "M.")(XMLModel.prototype, "toXML");
266
- __RΦ.m("rt:t", () => __RΦ.a(103))(XMLModel.prototype, "toXML");
267
- __RΦ.m("rt:t", () => __RΦ.a(879))(XMLModel.prototype, "properties");
267
+ __RΦ.m("rt:t", () => __RΦ.a(111))(XMLModel.prototype, "toXML");
268
+ __RΦ.m("rt:t", () => __RΦ.a(890))(XMLModel.prototype, "properties");
268
269
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "properties");
269
- __RΦ.m("rt:t", () => __RΦ.a(937))(XMLModel.prototype, "reflectedClass");
270
+ __RΦ.m("rt:t", () => __RΦ.a(948))(XMLModel.prototype, "reflectedClass");
270
271
  __RΦ.m("rt:f", "P")(XMLModel.prototype, "reflectedClass");
271
272
  __RΦ.m("rt:f", "M.")(XMLModel.prototype["resolveAllProperties"]);
272
273
  ((t, p) => __RΦ.m("rt:h", () => typeof t === "object" ? t.constructor : t)(t[p]))(XMLModel.prototype, "resolveAllProperties");
273
274
  __RΦ.m("rt:p", [])(XMLModel.prototype, "resolveAllProperties");
274
275
  __RΦ.m("rt:f", "M.")(XMLModel.prototype, "resolveAllProperties");
275
- __RΦ.m("rt:t", () => __RΦ.a(1058))(XMLModel.prototype, "resolveAllProperties");
276
+ __RΦ.m("rt:t", () => __RΦ.a(1069))(XMLModel.prototype, "resolveAllProperties");
276
277
  export function createModel(type, options) {
277
278
  if (findModel(type)) {
278
279
  throw new TypeError(`a model for type ${type.name} already exists`);
@@ -281,16 +282,16 @@ export function createModel(type, options) {
281
282
  Models.set(type, model);
282
283
  return model;
283
284
  }
284
- __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1646), v: null }, { n: "options", t: () => __RΦ.a(1645), v: null }])(createModel);
285
+ __RΦ.m("rt:p", [{ n: "type", t: () => __RΦ.a(1624), v: null }, { n: "options", t: () => __RΦ.a(1623), v: null }])(createModel);
285
286
  __RΦ.m("rt:f", "F")(createModel);
286
- __RΦ.m("rt:t", () => __RΦ.a(1679))(createModel);
287
+ __RΦ.m("rt:t", () => __RΦ.a(1657))(createModel);
287
288
  export const Models = new Map();
288
289
  export function findModel(id) {
289
290
  return Models.get(id);
290
291
  }
291
- __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1744), v: null }])(findModel);
292
+ __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1722), v: null }])(findModel);
292
293
  __RΦ.m("rt:f", "F")(findModel);
293
- __RΦ.m("rt:t", () => __RΦ.a(1757))(findModel);
294
+ __RΦ.m("rt:t", () => __RΦ.a(1735))(findModel);
294
295
  export function getModel(id) {
295
296
  const model = findModel(id);
296
297
  if (model)
@@ -298,18 +299,18 @@ export function getModel(id) {
298
299
  else
299
300
  throw new TypeError(`couln't find model for type ${id.name}`);
300
301
  }
301
- __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1958), v: null }])(getModel);
302
+ __RΦ.m("rt:p", [{ n: "id", t: () => __RΦ.a(1936), v: null }])(getModel);
302
303
  __RΦ.m("rt:f", "F")(getModel);
303
- __RΦ.m("rt:t", () => __RΦ.a(1961))(getModel);
304
+ __RΦ.m("rt:t", () => __RΦ.a(1939))(getModel);
304
305
  // Model decorator
305
306
  function ModelDecoratorFactory(options) {
306
307
  return __RΦ.f(function (constructor) {
307
308
  findModel(constructor) || createModel(constructor, options || {});
308
- }, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1967), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
309
+ }, [__RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1945), v: null }]), __RΦ.m("rt:f", "M"), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
309
310
  }
310
- __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1964), v: null, f: "?" }])(ModelDecoratorFactory);
311
+ __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1942), v: null, f: "?" }])(ModelDecoratorFactory);
311
312
  __RΦ.m("rt:f", "F")(ModelDecoratorFactory);
312
- __RΦ.m("rt:t", () => __RΦ.a(1966))(ModelDecoratorFactory);
313
+ __RΦ.m("rt:t", () => __RΦ.a(1944))(ModelDecoratorFactory);
313
314
  export { ModelDecoratorFactory as Model };
314
315
  export { Prop } from "./property";
315
316
  import "../defaults/models";
@@ -13,17 +13,17 @@ 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: { [197]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(189)] }) }, [194]: { LΦ: t => LΦ_0.IΦConstructor }, [189]: { LΦ: t => Object }, [193]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(190), p: [__RΦ.a(189)] }) }, [190]: { LΦ: t => LΦ_1.IΦCreateXMLModelPropertyOptions }, [205]: { LΦ: t => Object }, [209]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(206), p: [__RΦ.a(189)] }) }, [206]: { LΦ: t => LΦ_1.IΦXMLModelPropertyOptions }, [492]: { LΦ: t => LΦ_0.ReflectedProperty }, [13]: { LΦ: t => String }, [4]: { RΦ: t => ({ TΦ: "~" }) }, [20]: { LΦ: t => Boolean }, [102]: { RΦ: t => ({ TΦ: "[", e: __RΦ.a(101) }) }, [101]: { LΦ: t => LΦ_2.IΦElement }, [1]: { RΦ: t => ({ TΦ: "~" }) }, [103]: { RΦ: t => ({ TΦ: "O", m: [{ n: "elements", f: "", t: __RΦ.a(102) }] }) }, [1396]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(1395)] }) }, [1395]: { LΦ: t => Object }, [1398]: { LΦ: t => Object }, [1399]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(206), p: [__RΦ.a(1395)] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [1411]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(1410)] }) }, [1410]: { LΦ: t => Object }, [1413]: { LΦ: t => Object }, [1422]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1414)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1414]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(206), p: [__RΦ.a(1410)] }) }, [1428]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(194), p: [__RΦ.a(1427)] }) }, [1427]: { LΦ: t => Object }, [1430]: { LΦ: t => Object }, [1454]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(206), p: [__RΦ.a(1427)] }) }, [1461]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(190), p: [__RΦ.a(1460)] }) }, [1460]: { LΦ: t => Object }, [1463]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1465), v: null }], f: "" }) }, [1465]: { LΦ: t => Object } } };
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) }] }) }, [1407]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1406)] }) }, [1406]: { LΦ: t => Object }, [1409]: { LΦ: t => Object }, [1410]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1406)] }) }, [22]: { RΦ: t => ({ TΦ: "V" }) }, [1422]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1421)] }) }, [1421]: { LΦ: t => Object }, [1424]: { LΦ: t => Object }, [1433]: { RΦ: t => ({ TΦ: "|", t: [__RΦ.a(10), __RΦ.a(1425)] }) }, [10]: { RΦ: t => ({ TΦ: "u" }) }, [1425]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1421)] }) }, [1439]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(202), p: [__RΦ.a(1438)] }) }, [1438]: { LΦ: t => Object }, [1441]: { LΦ: t => Object }, [1465]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(214), p: [__RΦ.a(1438)] }) }, [1472]: { RΦ: t => ({ TΦ: "g", t: __RΦ.a(198), p: [__RΦ.a(1471)] }) }, [1471]: { LΦ: t => Object }, [1474]: { RΦ: t => ({ TΦ: "F", r: __RΦ.a(22), p: [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1476), v: null }], f: "" }) }, [1476]: { LΦ: t => Object } } };
17
17
  import { reflect } from "typescript-rtti";
18
18
  import * as LΦ_1 from "./types";
19
- import * as LΦ_2 from "xml-js/types";
19
+ import * as LΦ_2 from "../types";
20
20
  import { defaults } from "../defaults";
21
21
  import * as LΦ_0 from "typescript-rtti/dist";
22
22
  function resolvePropertyConversionOptions(options, constructor, property) {
23
23
  const _options = {
24
24
  name: property,
25
25
  get reflected() {
26
- return reflect(constructor, { TΦ: "c", t: void 0, p: [__RΦ.a(197)], r: void 0, tp: [] }).getProperty(property);
26
+ return reflect(constructor, { TΦ: "c", t: void 0, p: [__RΦ.a(205)], r: void 0, tp: [] }).getProperty(property);
27
27
  },
28
28
  get tagname() {
29
29
  return options.tagname || defaults.tagnameFromProperty(this);
@@ -33,13 +33,13 @@ function resolvePropertyConversionOptions(options, constructor, property) {
33
33
  isSourceElement: __RΦ.f((...args) => 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.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(102))], ""),
36
+ : __RΦ.f((...args) => 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(107))], ""),
37
37
  fromXML: __RΦ.f((context) => (options.fromXML || 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.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(103))], "toXML"),
38
+ toXML: __RΦ.f((context) => (options.toXML || 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(111))], "toXML"),
39
39
  };
40
- if (options?.model)
40
+ if (options === null || options === void 0 ? void 0 : options.model)
41
41
  _options.model = options.model;
42
- if (options?.sourceElements) {
42
+ if (options === null || options === void 0 ? void 0 : options.sourceElements) {
43
43
  const _sourceElements = options.sourceElements;
44
44
  if (typeof _sourceElements === "string") {
45
45
  _options.isSourceElement = __RΦ.f((element) => element.name === _sourceElements, [__RΦ.m("rt:p", [{ n: "element", t: () => __RΦ.a(4), v: null }]), __RΦ.m("rt:f", "F>"), __RΦ.m("rt:t", () => __RΦ.a(20))], "");
@@ -53,9 +53,9 @@ function resolvePropertyConversionOptions(options, constructor, property) {
53
53
  }
54
54
  return _options;
55
55
  }
56
- __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(193), v: null }, { n: "constructor", t: () => __RΦ.a(197), v: null }, { n: "property", t: () => __RΦ.a(205), v: null }])(resolvePropertyConversionOptions);
56
+ __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(201), v: null }, { n: "constructor", t: () => __RΦ.a(205), v: null }, { n: "property", t: () => __RΦ.a(213), v: null }])(resolvePropertyConversionOptions);
57
57
  __RΦ.m("rt:f", "F")(resolvePropertyConversionOptions);
58
- __RΦ.m("rt:t", () => __RΦ.a(209))(resolvePropertyConversionOptions);
58
+ __RΦ.m("rt:t", () => __RΦ.a(217))(resolvePropertyConversionOptions);
59
59
  const PropertyOptions = new Map();
60
60
  function storePropertyConversionOptions(constructor, property, options) {
61
61
  let map = PropertyOptions.get(constructor);
@@ -65,7 +65,7 @@ function storePropertyConversionOptions(constructor, property, options) {
65
65
  }
66
66
  map.set(property, options);
67
67
  }
68
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1396), v: null }, { n: "property", t: () => __RΦ.a(1398), v: null }, { n: "options", t: () => __RΦ.a(1399), v: null }])(storePropertyConversionOptions);
68
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1407), v: null }, { n: "property", t: () => __RΦ.a(1409), v: null }, { n: "options", t: () => __RΦ.a(1410), v: null }])(storePropertyConversionOptions);
69
69
  __RΦ.m("rt:f", "F")(storePropertyConversionOptions);
70
70
  __RΦ.m("rt:t", () => __RΦ.a(22))(storePropertyConversionOptions);
71
71
  function findPropertyConversionOptions(constructor, property) {
@@ -74,23 +74,23 @@ function findPropertyConversionOptions(constructor, property) {
74
74
  return options.get(property);
75
75
  }
76
76
  }
77
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1411), v: null }, { n: "property", t: () => __RΦ.a(1413), v: null }])(findPropertyConversionOptions);
77
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1422), v: null }, { n: "property", t: () => __RΦ.a(1424), v: null }])(findPropertyConversionOptions);
78
78
  __RΦ.m("rt:f", "F")(findPropertyConversionOptions);
79
- __RΦ.m("rt:t", () => __RΦ.a(1422))(findPropertyConversionOptions);
79
+ __RΦ.m("rt:t", () => __RΦ.a(1433))(findPropertyConversionOptions);
80
80
  export function getPropertyConversionOptions(constructor, property) {
81
81
  const options = findPropertyConversionOptions(constructor, property);
82
82
  return options || resolvePropertyConversionOptions({}, constructor, property);
83
83
  }
84
- __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1428), v: null }, { n: "property", t: () => __RΦ.a(1430), v: null }])(getPropertyConversionOptions);
84
+ __RΦ.m("rt:p", [{ n: "constructor", t: () => __RΦ.a(1439), v: null }, { n: "property", t: () => __RΦ.a(1441), v: null }])(getPropertyConversionOptions);
85
85
  __RΦ.m("rt:f", "F")(getPropertyConversionOptions);
86
- __RΦ.m("rt:t", () => __RΦ.a(1454))(getPropertyConversionOptions);
86
+ __RΦ.m("rt:t", () => __RΦ.a(1465))(getPropertyConversionOptions);
87
87
  function PropDecoratorFactory(options) {
88
88
  return __RΦ.f(function (prototype, property) {
89
89
  const _options = resolvePropertyConversionOptions(options || {}, prototype.constructor, property);
90
90
  storePropertyConversionOptions(prototype.constructor, property, _options);
91
- }, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1465), v: null }]), __RΦ.m("rt:f", "M."), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
91
+ }, [__RΦ.m("rt:p", [{ n: "prototype", t: () => __RΦ.a(1), v: null }, { n: "property", t: () => __RΦ.a(1476), v: null }]), __RΦ.m("rt:f", "M."), __RΦ.m("rt:t", () => __RΦ.a(22))], "");
92
92
  }
93
- __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1461), v: null, f: "?" }])(PropDecoratorFactory);
93
+ __RΦ.m("rt:p", [{ n: "options", t: () => __RΦ.a(1472), v: null, f: "?" }])(PropDecoratorFactory);
94
94
  __RΦ.m("rt:f", "F")(PropDecoratorFactory);
95
- __RΦ.m("rt:t", () => __RΦ.a(1463))(PropDecoratorFactory);
95
+ __RΦ.m("rt:t", () => __RΦ.a(1474))(PropDecoratorFactory);
96
96
  export { PropDecoratorFactory as Prop };