@dialecte/core 0.0.9 → 0.0.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../../src/chain-methods/mutations/clone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAc,MAAM,SAAS,CAAA;AAE7F;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAC/C,MAAM,EAAE;IACT,KAAK,EAAE,YAAY,CAAA;IACnB,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAA;IAC/D,cAAc,EAAE,aAAa,CAAA;CAC7B,IAGiB,mBAAmB,SAAS,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,EACrF,QAAQ,oBAAoB,CAAC,aAAa,EAAE,cAAc,CAAC,sFAiE5D"}
1
+ {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../../src/chain-methods/mutations/clone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAc,MAAM,SAAS,CAAA;AAE7F;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,UAAU,CAAC,aAAa,CAAC,EAC/C,MAAM,EAAE;IACT,KAAK,EAAE,YAAY,CAAA;IACnB,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAA;IAC/D,cAAc,EAAE,aAAa,CAAA;CAC7B,IAGiB,mBAAmB,SAAS,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,EACrF,QAAQ,oBAAoB,CAAC,aAAa,EAAE,cAAc,CAAC,sFAkE5D"}
package/dist/index.js CHANGED
@@ -86,11 +86,11 @@ function la(l) {
86
86
  children: c.children ?? []
87
87
  };
88
88
  if (!u.elements.includes(h)) return q;
89
- const z = u.definition[h].attributes.sequence, H = u.definition[h].attributes.details, M = z.flatMap((J) => {
90
- const re = H[J].required, ye = H[J]?.namespace || void 0, Y = P.find((ie) => ie.name === J)?.value || (re ? H[J]?.default || "" : void 0);
89
+ const z = u.definition[h].attributes.sequence, H = u.definition[h].attributes.details, M = z.flatMap((Z) => {
90
+ const re = H[Z].required, ye = H[Z]?.namespace || void 0, Y = P.find((ie) => ie.name === Z)?.value || (re ? H[Z]?.default || "" : void 0);
91
91
  return Y === void 0 ? [] : [
92
92
  {
93
- name: J,
93
+ name: Z,
94
94
  value: Y,
95
95
  namespace: ye
96
96
  }
@@ -586,12 +586,12 @@ function go(l, c, u) {
586
586
  sequence: V,
587
587
  details: Object.fromEntries(
588
588
  V.map((F) => {
589
- const J = q.required.includes(F), ye = F.startsWith("c") ? qe.ext : P;
589
+ const Z = q.required.includes(F), ye = F.startsWith("c") ? qe.ext : P;
590
590
  return [
591
591
  F,
592
592
  {
593
593
  namespace: ye,
594
- required: J,
594
+ required: Z,
595
595
  default: null,
596
596
  validation: Ct
597
597
  }
@@ -604,7 +604,7 @@ function go(l, c, u) {
604
604
  sequence: b,
605
605
  details: Object.fromEntries(
606
606
  b.map((F) => {
607
- const J = Zr(F), re = J === 1;
607
+ const Z = Zr(F), re = Z === 1;
608
608
  return [
609
609
  F,
610
610
  {
@@ -612,7 +612,7 @@ function go(l, c, u) {
612
612
  validation: {
613
613
  ...Ct,
614
614
  minOccurrence: re ? 1 : null,
615
- maxOccurrence: J
615
+ maxOccurrence: Z
616
616
  },
617
617
  constraints: []
618
618
  }
@@ -777,7 +777,7 @@ function xo() {
777
777
  return e.prototype = Object.create(t.prototype), M(e.prototype, "constructor", e), { extend: z.bind(null, e.prototype) };
778
778
  } };
779
779
  }
780
- var J = Object.getOwnPropertyDescriptor, re = [].slice;
780
+ var Z = Object.getOwnPropertyDescriptor, re = [].slice;
781
781
  function ye(e, t, n) {
782
782
  return re.call(e, t, n);
783
783
  }
@@ -923,7 +923,7 @@ function xo() {
923
923
  }, {}), ue = Me.reduce(function(e, t) {
924
924
  return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = O[t]), e;
925
925
  }, {});
926
- function Z() {
926
+ function J() {
927
927
  }
928
928
  function he(e) {
929
929
  return e;
@@ -939,7 +939,7 @@ function xo() {
939
939
  };
940
940
  }
941
941
  function Je(e, t) {
942
- return e === Z ? t : function() {
942
+ return e === J ? t : function() {
943
943
  var n = e.apply(this, arguments);
944
944
  n !== void 0 && (arguments[0] = n);
945
945
  var r = this.onsuccess, a = this.onerror;
@@ -949,14 +949,14 @@ function xo() {
949
949
  };
950
950
  }
951
951
  function Ae(e, t) {
952
- return e === Z ? t : function() {
952
+ return e === J ? t : function() {
953
953
  e.apply(this, arguments);
954
954
  var n = this.onsuccess, r = this.onerror;
955
955
  this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? ve(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? ve(r, this.onerror) : r);
956
956
  };
957
957
  }
958
958
  function Ke(e, t) {
959
- return e === Z ? t : function(n) {
959
+ return e === J ? t : function(n) {
960
960
  var r = e.apply(this, arguments);
961
961
  R(n, r);
962
962
  var a = this.onsuccess, i = this.onerror;
@@ -964,12 +964,12 @@ function xo() {
964
964
  };
965
965
  }
966
966
  function In(e, t) {
967
- return e === Z ? t : function() {
967
+ return e === J ? t : function() {
968
968
  return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
969
969
  };
970
970
  }
971
971
  function wt(e, t) {
972
- return e === Z ? t : function() {
972
+ return e === J ? t : function() {
973
973
  var n = e.apply(this, arguments);
974
974
  if (n && typeof n.then == "function") {
975
975
  for (var r = this, a = arguments.length, i = new Array(a); a--; ) i[a] = arguments[a];
@@ -992,7 +992,7 @@ function xo() {
992
992
  return [t, P(t), e];
993
993
  })(), Mt = ft[0], Me = ft[1], ft = ft[2], Me = Me && Me.then, dt = Mt && Mt.constructor, Dn = !!ft, jt = function(e, t) {
994
994
  Kt.push([e, t]), Zt && (queueMicrotask(Ra), Zt = !1);
995
- }, Pn = !0, Zt = !0, ht = [], Jt = [], Sn = he, et = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Z, pgp: !1, env: {}, finalize: Z }, Q = et, Kt = [], mt = 0, en = [];
995
+ }, Pn = !0, Zt = !0, ht = [], Jt = [], Sn = he, et = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: J, pgp: !1, env: {}, finalize: J }, Q = et, Kt = [], mt = 0, en = [];
996
996
  function X(e) {
997
997
  if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
998
998
  this._listeners = [], this._lib = !1;
@@ -1277,7 +1277,7 @@ function xo() {
1277
1277
  function Kn(e) {
1278
1278
  Promise === dt && we.echoes === 0 ? rn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
1279
1279
  }
1280
- ("" + Me).indexOf("[native code]") === -1 && (xt = nt = Z);
1280
+ ("" + Me).indexOf("[native code]") === -1 && (xt = nt = J);
1281
1281
  var be = X.reject, gt = "￿", Xe = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Br = "String expected.", Tt = [], sn = "__dbnames", qn = "readonly", Ln = "readwrite";
1282
1282
  function yt(e, t) {
1283
1283
  return e ? t ? function() {
@@ -1376,7 +1376,7 @@ function xo() {
1376
1376
  if (w._state.openComplete) return be(new O.DatabaseClosed(w._state.dbOpenError));
1377
1377
  if (!w._state.isBeingOpened) {
1378
1378
  if (!w._state.autoOpen) return be(new O.DatabaseClosed());
1379
- w.open().catch(Z);
1379
+ w.open().catch(J);
1380
1380
  }
1381
1381
  return w._state.dbReadyPromise.then(function() {
1382
1382
  return C(w, g, T, _);
@@ -1628,7 +1628,7 @@ function xo() {
1628
1628
  if (typeof d != "object") {
1629
1629
  var C;
1630
1630
  p = p || In;
1631
- var w = { subscribers: [], fire: v = v || Z, subscribe: function(g) {
1631
+ var w = { subscribers: [], fire: v = v || J, subscribe: function(g) {
1632
1632
  w.subscribers.indexOf(g) === -1 && (w.subscribers.push(g), w.fire = p(w.fire, g));
1633
1633
  }, unsubscribe: function(g) {
1634
1634
  w.subscribers = w.subscribers.filter(function(T) {
@@ -1706,9 +1706,9 @@ function xo() {
1706
1706
  t && !t(i, function(p) {
1707
1707
  return d = p;
1708
1708
  }, function(p) {
1709
- i.stop(p), d = Z;
1709
+ i.stop(p), d = J;
1710
1710
  }, function(p) {
1711
- i.fail(p), d = Z;
1711
+ i.fail(p), d = J;
1712
1712
  }) || a(i.value, i, function(p) {
1713
1713
  return d = p;
1714
1714
  }), d();
@@ -2497,7 +2497,7 @@ function xo() {
2497
2497
  var i = r[a];
2498
2498
  t.forEach(function(d) {
2499
2499
  var p = (function v(C, w) {
2500
- return J(C, w) || (C = P(C)) && v(C, w);
2500
+ return Z(C, w) || (C = P(C)) && v(C, w);
2501
2501
  })(d, a);
2502
2502
  (!p || "value" in p && p.value === void 0) && (d === e.Transaction.prototype || d instanceof e.Transaction ? M(d, a, { get: function() {
2503
2503
  return this.table(a);
@@ -2682,7 +2682,7 @@ function xo() {
2682
2682
  R(r, i._cfg.storesSource), a = i._cfg.dbschema = {}, i._parseStoresSpec(r, a);
2683
2683
  }), t._dbSchema = a, Yn(t, [t._allTables, t, t.Transaction.prototype]), mn(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], y(a), a), t._storeNames = y(a), this;
2684
2684
  }, Rt.prototype.upgrade = function(e) {
2685
- return this._cfg.contentUpgrade = wt(this._cfg.contentUpgrade || Z, e), this;
2685
+ return this._cfg.contentUpgrade = wt(this._cfg.contentUpgrade || J, e), this;
2686
2686
  }, Rt);
2687
2687
  function Rt() {
2688
2688
  }
@@ -2860,7 +2860,7 @@ function xo() {
2860
2860
  t.vcFired = !0, e.on("versionchange").fire(L);
2861
2861
  }), j.onclose = ge(function(L) {
2862
2862
  e.on("close").fire(L);
2863
- }), g && (k = e._deps, K = A, j = k.indexedDB, k = k.IDBKeyRange, Zn(j) || K === sn || Hn(j, k).put({ name: K }).catch(Z)), T();
2863
+ }), g && (k = e._deps, K = A, j = k.indexedDB, k = k.IDBKeyRange, Zn(j) || K === sn || Hn(j, k).put({ name: K }).catch(J)), T();
2864
2864
  }, _);
2865
2865
  }).catch(function(T) {
2866
2866
  switch (T?.name) {
@@ -2886,7 +2886,7 @@ function xo() {
2886
2886
  return e.on.ready.fire(e.vip);
2887
2887
  })).then(function T() {
2888
2888
  if (0 < t.onReadyBeingFired.length) {
2889
- var _ = t.onReadyBeingFired.reduce(wt, Z);
2889
+ var _ = t.onReadyBeingFired.reduce(wt, J);
2890
2890
  return t.onReadyBeingFired = [], X.resolve(Jn(function() {
2891
2891
  return _(e.vip);
2892
2892
  })).then(T);
@@ -2995,22 +2995,22 @@ function xo() {
2995
2995
  var i = Q.trans, d = i.table(t).hook, p = d.deleting, v = d.creating, C = d.updating;
2996
2996
  switch (a.type) {
2997
2997
  case "add":
2998
- if (v.fire === Z) break;
2998
+ if (v.fire === J) break;
2999
2999
  return i._promise("readwrite", function() {
3000
3000
  return w(a);
3001
3001
  }, !0);
3002
3002
  case "put":
3003
- if (v.fire === Z && C.fire === Z) break;
3003
+ if (v.fire === J && C.fire === J) break;
3004
3004
  return i._promise("readwrite", function() {
3005
3005
  return w(a);
3006
3006
  }, !0);
3007
3007
  case "delete":
3008
- if (p.fire === Z) break;
3008
+ if (p.fire === J) break;
3009
3009
  return i._promise("readwrite", function() {
3010
3010
  return w(a);
3011
3011
  }, !0);
3012
3012
  case "deleteRange":
3013
- if (p.fire === Z) break;
3013
+ if (p.fire === J) break;
3014
3014
  return i._promise("readwrite", function() {
3015
3015
  return (function g(T, _, A) {
3016
3016
  return n.query({ trans: T, values: !1, query: { index: r, range: _ }, limit: A }).then(function(x) {
@@ -3381,7 +3381,7 @@ function xo() {
3381
3381
  if (t._state.openComplete) return r(new O.DatabaseClosed(t._state.dbOpenError));
3382
3382
  if (!t._state.isBeingOpened) {
3383
3383
  if (!t._state.autoOpen) return void r(new O.DatabaseClosed());
3384
- t.open().catch(Z);
3384
+ t.open().catch(J);
3385
3385
  }
3386
3386
  t._state.dbReadyPromise.then(n, r);
3387
3387
  }).then(e);
@@ -3428,7 +3428,7 @@ function xo() {
3428
3428
  var p = t._deps.indexedDB.deleteDatabase(t.name);
3429
3429
  p.onsuccess = ge(function() {
3430
3430
  var v, C, w;
3431
- v = t._deps, C = t.name, w = v.indexedDB, v = v.IDBKeyRange, Zn(w) || C === sn || Hn(w, v).delete(C).catch(Z), a();
3431
+ v = t._deps, C = t.name, w = v.indexedDB, v = v.IDBKeyRange, Zn(w) || C === sn || Hn(w, v).delete(C).catch(J), a();
3432
3432
  }), p.onerror = Ue(i), p.onblocked = t._fireOnBlocked;
3433
3433
  }
3434
3434
  if (n) throw new O.InvalidArgument("Invalid closeOptions argument to db.delete()");
@@ -3529,12 +3529,12 @@ function xo() {
3529
3529
  this._middlewares = {}, this.verno = 0;
3530
3530
  var r = Ce.dependencies;
3531
3531
  this._options = t = o({ addons: Ce.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
3532
- var a, i, d, p, v, C = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Z, dbReadyPromise: null, cancelOpen: Z, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
3532
+ var a, i, d, p, v, C = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: J, dbReadyPromise: null, cancelOpen: J, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
3533
3533
  C.dbReadyPromise = new X(function(g) {
3534
3534
  C.dbReadyResolve = g;
3535
3535
  }), C.openCanceller = new X(function(g, T) {
3536
3536
  C.cancelOpen = T;
3537
- }), this._state = C, this.name = e, this.on = qt(this, "populate", "blocked", "versionchange", "close", { ready: [wt, Z] }), this.once = function(g, T) {
3537
+ }), this._state = C, this.name = e, this.on = qt(this, "populate", "blocked", "versionchange", "close", { ready: [wt, J] }), this.once = function(g, T) {
3538
3538
  var _ = function() {
3539
3539
  for (var A = [], x = 0; x < arguments.length; x++) A[x] = arguments[x];
3540
3540
  n.on(g).unsubscribe(_), T.apply(n, A);
@@ -3560,7 +3560,7 @@ function xo() {
3560
3560
  var x = N._ctx, E = x.table, N = E.hook.reading.fire;
3561
3561
  this._ctx = { table: E, index: x.index, isPrimKey: !x.index || E.schema.primKey.keyPath && x.index === E.schema.primKey.name, range: _, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: A, or: x.or, valueMapper: N !== he ? N : null };
3562
3562
  })), this.Table = (i = this, Lt(Or.prototype, function(g, T, _) {
3563
- this.db = i, this._tx = _, this.name = g, this.schema = T, this.hook = i._allTables[g] ? i._allTables[g].hook : qt(null, { creating: [Je, Z], reading: [xe, he], updating: [Ke, Z], deleting: [Ae, Z] });
3563
+ this.db = i, this._tx = _, this.name = g, this.schema = T, this.hook = i._allTables[g] ? i._allTables[g].hook : qt(null, { creating: [Je, J], reading: [xe, he], updating: [Ke, J], deleting: [Ae, J] });
3564
3564
  })), this.Transaction = (d = this, Lt(Ma.prototype, function(g, T, _, A, x) {
3565
3565
  var E = this;
3566
3566
  g !== "readonly" && T.forEach(function(N) {
@@ -4072,8 +4072,8 @@ function Wo() {
4072
4072
  });
4073
4073
  function h(f) {
4074
4074
  for (var s = Math.max(c.MAX_BUFFER_LENGTH, 10), O = 0, B = 0, ue = u.length; B < ue; B++) {
4075
- var Z = f[u[B]].length;
4076
- if (Z > s)
4075
+ var J = f[u[B]].length;
4076
+ if (J > s)
4077
4077
  switch (u[B]) {
4078
4078
  case "textNode":
4079
4079
  Se(f);
@@ -4087,7 +4087,7 @@ function Wo() {
4087
4087
  default:
4088
4088
  Ve(f, "Max buffer length exceeded: " + u[B]);
4089
4089
  }
4090
- O = Math.max(O, Z);
4090
+ O = Math.max(O, J);
4091
4091
  }
4092
4092
  var he = c.MAX_BUFFER_LENGTH - O;
4093
4093
  f.bufferCheckPosition = he + f.position;
@@ -4172,7 +4172,7 @@ function Wo() {
4172
4172
  B.splice(0, 0, f), O.emit.apply(O, B);
4173
4173
  }), b.prototype.on.call(O, f, s);
4174
4174
  };
4175
- var V = "[CDATA[", z = "DOCTYPE", H = "http://www.w3.org/XML/1998/namespace", M = "http://www.w3.org/2000/xmlns/", F = { xml: H, xmlns: M }, J = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, re = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, ye = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, ee = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
4175
+ var V = "[CDATA[", z = "DOCTYPE", H = "http://www.w3.org/XML/1998/namespace", M = "http://www.w3.org/2000/xmlns/", F = { xml: H, xmlns: M }, Z = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, re = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, ye = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, ee = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
4176
4176
  function Y(f) {
4177
4177
  return f === " " || f === `
4178
4178
  ` || f === "\r" || f === " ";
@@ -4562,8 +4562,8 @@ Char: ` + f.c), s = new Error(s), f.error = s, ze(f, "onerror", s), f;
4562
4562
  f.opt.xmlns && (O.ns = s.ns), f.attribList.length = 0, de(f, "onopentagstart", O);
4563
4563
  }
4564
4564
  function Le(f, s) {
4565
- var O = f.indexOf(":"), B = O < 0 ? ["", f] : f.split(":"), ue = B[0], Z = B[1];
4566
- return s && f === "xmlns" && (ue = "xmlns", Z = ""), { prefix: ue, local: Z };
4565
+ var O = f.indexOf(":"), B = O < 0 ? ["", f] : f.split(":"), ue = B[0], J = B[1];
4566
+ return s && f === "xmlns" && (ue = "xmlns", J = ""), { prefix: ue, local: J };
4567
4567
  }
4568
4568
  function ke(f) {
4569
4569
  if (f.strict || (f.attribName = f.attribName[f.looseCase]()), f.attribList.indexOf(f.attribName) !== -1 || f.tag.attributes.hasOwnProperty(f.attribName)) {
@@ -4586,8 +4586,8 @@ Actual: ` + f.attribValue
4586
4586
  Actual: ` + f.attribValue
4587
4587
  );
4588
4588
  else {
4589
- var ue = f.tag, Z = f.tags[f.tags.length - 1] || f;
4590
- ue.ns === Z.ns && (ue.ns = Object.create(Z.ns)), ue.ns[B] = f.attribValue;
4589
+ var ue = f.tag, J = f.tags[f.tags.length - 1] || f;
4590
+ ue.ns === J.ns && (ue.ns = Object.create(J.ns)), ue.ns[B] = f.attribValue;
4591
4591
  }
4592
4592
  f.attribList.push([f.attribName, f.attribValue]);
4593
4593
  } else
@@ -4611,8 +4611,8 @@ Actual: ` + f.attribValue
4611
4611
  uri: O.ns[kt]
4612
4612
  });
4613
4613
  });
4614
- for (var Z = 0, he = f.attribList.length; Z < he; Z++) {
4615
- var xe = f.attribList[Z], ve = xe[0], Je = xe[1], Ae = Le(ve, !0), Ke = Ae.prefix, In = Ae.local, wt = Ke === "" ? "" : O.ns[Ke] || "", De = {
4614
+ for (var J = 0, he = f.attribList.length; J < he; J++) {
4615
+ var xe = f.attribList[J], ve = xe[0], Je = xe[1], Ae = Le(ve, !0), Ke = Ae.prefix, In = Ae.local, wt = Ke === "" ? "" : O.ns[Ke] || "", De = {
4616
4616
  name: ve,
4617
4617
  value: Je,
4618
4618
  prefix: Ke,
@@ -4654,7 +4654,7 @@ Actual: ` + f.attribValue
4654
4654
  return;
4655
4655
  }
4656
4656
  f.tagName = O;
4657
- for (var Z = f.tags.length; Z-- > s; ) {
4657
+ for (var J = f.tags.length; J-- > s; ) {
4658
4658
  var he = f.tag = f.tags.pop();
4659
4659
  f.tagName = f.tag.name, de(f, "onclosetag", f.tagName);
4660
4660
  var xe = {};
@@ -4704,10 +4704,10 @@ Actual: ` + f.attribValue
4704
4704
  continue;
4705
4705
  case I.TEXT:
4706
4706
  if (s.sawRoot && !s.closedRoot) {
4707
- for (var Z = O - 1; B && B !== "<" && B !== "&"; )
4707
+ for (var J = O - 1; B && B !== "<" && B !== "&"; )
4708
4708
  B = He(f, O++), B && s.trackPosition && (s.position++, B === `
4709
4709
  ` ? (s.line++, s.column = 0) : s.column++);
4710
- s.textNode += f.substring(Z, O - 1);
4710
+ s.textNode += f.substring(J, O - 1);
4711
4711
  }
4712
4712
  B === "<" && !(s.sawRoot && s.closedRoot && !s.strict) ? (s.state = I.OPEN_WAKA, s.startTagPosition = s.position) : (!Y(B) && (!s.sawRoot || s.closedRoot) && fe(s, "Text data outside of root node."), B === "&" ? s.state = I.TEXT_ENTITY : s.textNode += B);
4713
4713
  continue;
@@ -4720,7 +4720,7 @@ Actual: ` + f.attribValue
4720
4720
  case I.OPEN_WAKA:
4721
4721
  if (B === "!")
4722
4722
  s.state = I.SGML_DECL, s.sgmlDecl = "";
4723
- else if (!Y(B)) if (oe(J, B))
4723
+ else if (!Y(B)) if (oe(Z, B))
4724
4724
  s.state = I.OPEN_TAG, s.tagName = B;
4725
4725
  else if (B === "/")
4726
4726
  s.state = I.CLOSE_TAG, s.tagName = "";
@@ -4769,10 +4769,10 @@ Actual: ` + f.attribValue
4769
4769
  B !== ">" ? (fe(s, "Malformed comment"), s.comment += "--" + B, s.state = I.COMMENT) : s.doctype && s.doctype !== !0 ? s.state = I.DOCTYPE_DTD : s.state = I.TEXT;
4770
4770
  continue;
4771
4771
  case I.CDATA:
4772
- for (var Z = O - 1; B && B !== "]"; )
4772
+ for (var J = O - 1; B && B !== "]"; )
4773
4773
  B = He(f, O++), B && s.trackPosition && (s.position++, B === `
4774
4774
  ` ? (s.line++, s.column = 0) : s.column++);
4775
- s.cdata += f.substring(Z, O - 1), B === "]" && (s.state = I.CDATA_ENDING);
4775
+ s.cdata += f.substring(J, O - 1), B === "]" && (s.state = I.CDATA_ENDING);
4776
4776
  continue;
4777
4777
  case I.CDATA_ENDING:
4778
4778
  B === "]" ? s.state = I.CDATA_ENDING_2 : (s.cdata += "]" + B, s.state = I.CDATA);
@@ -4806,7 +4806,7 @@ Actual: ` + f.attribValue
4806
4806
  case I.ATTRIB:
4807
4807
  if (Y(B))
4808
4808
  continue;
4809
- B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(J, B) ? (s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4809
+ B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(Z, B) ? (s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4810
4810
  continue;
4811
4811
  case I.ATTRIB_NAME:
4812
4812
  B === "=" ? s.state = I.ATTRIB_VALUE : B === ">" ? (fe(s, "Attribute without value"), s.attribValue = s.attribName, ke(s), je(s)) : Y(B) ? s.state = I.ATTRIB_NAME_SAW_WHITE : oe(re, B) ? s.attribName += B : fe(s, "Invalid attribute name");
@@ -4820,7 +4820,7 @@ Actual: ` + f.attribValue
4820
4820
  fe(s, "Attribute without value"), s.tag.attributes[s.attribName] = "", s.attribValue = "", de(s, "onattribute", {
4821
4821
  name: s.attribName,
4822
4822
  value: ""
4823
- }), s.attribName = "", B === ">" ? je(s) : oe(J, B) ? (s.attribName = B, s.state = I.ATTRIB_NAME) : (fe(s, "Invalid attribute name"), s.state = I.ATTRIB);
4823
+ }), s.attribName = "", B === ">" ? je(s) : oe(Z, B) ? (s.attribName = B, s.state = I.ATTRIB_NAME) : (fe(s, "Invalid attribute name"), s.state = I.ATTRIB);
4824
4824
  }
4825
4825
  continue;
4826
4826
  case I.ATTRIB_VALUE:
@@ -4836,7 +4836,7 @@ Actual: ` + f.attribValue
4836
4836
  ke(s), s.q = "", s.state = I.ATTRIB_VALUE_CLOSED;
4837
4837
  continue;
4838
4838
  case I.ATTRIB_VALUE_CLOSED:
4839
- Y(B) ? s.state = I.ATTRIB : B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(J, B) ? (fe(s, "No whitespace between attributes"), s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4839
+ Y(B) ? s.state = I.ATTRIB : B === ">" ? je(s) : B === "/" ? s.state = I.OPEN_TAG_SLASH : oe(Z, B) ? (fe(s, "No whitespace between attributes"), s.attribName = B, s.attribValue = "", s.state = I.ATTRIB_NAME) : fe(s, "Invalid attribute name");
4840
4840
  continue;
4841
4841
  case I.ATTRIB_VALUE_UNQUOTED:
4842
4842
  if (!pe(B)) {
@@ -4851,7 +4851,7 @@ Actual: ` + f.attribValue
4851
4851
  else {
4852
4852
  if (Y(B))
4853
4853
  continue;
4854
- Re(J, B) ? s.script ? (s.script += "</" + B, s.state = I.SCRIPT) : fe(s, "Invalid tagname in closing tag.") : s.tagName = B;
4854
+ Re(Z, B) ? s.script ? (s.script += "</" + B, s.state = I.SCRIPT) : fe(s, "Invalid tagname in closing tag.") : s.tagName = B;
4855
4855
  }
4856
4856
  continue;
4857
4857
  case I.CLOSE_TAG_SAW_WHITE:
@@ -4886,7 +4886,7 @@ Actual: ` + f.attribValue
4886
4886
  }
4887
4887
  String.fromCodePoint || (function() {
4888
4888
  var f = String.fromCharCode, s = Math.floor, O = function() {
4889
- var B = 16384, ue = [], Z, he, xe = -1, ve = arguments.length;
4889
+ var B = 16384, ue = [], J, he, xe = -1, ve = arguments.length;
4890
4890
  if (!ve)
4891
4891
  return "";
4892
4892
  for (var Je = ""; ++xe < ve; ) {
@@ -4896,7 +4896,7 @@ Actual: ` + f.attribValue
4896
4896
  Ae > 1114111 || // not a valid Unicode code point
4897
4897
  s(Ae) !== Ae)
4898
4898
  throw RangeError("Invalid code point: " + Ae);
4899
- Ae <= 65535 ? ue.push(Ae) : (Ae -= 65536, Z = (Ae >> 10) + 55296, he = Ae % 1024 + 56320, ue.push(Z, he)), (xe + 1 === ve || ue.length > B) && (Je += f.apply(null, ue), ue.length = 0);
4899
+ Ae <= 65535 ? ue.push(Ae) : (Ae -= 65536, J = (Ae >> 10) + 55296, he = Ae % 1024 + 56320, ue.push(J, he)), (xe + 1 === ve || ue.length > B) && (Je += f.apply(null, ue), ue.length = 0);
4900
4900
  }
4901
4901
  return Je;
4902
4902
  };
@@ -5239,7 +5239,7 @@ function di() {
5239
5239
  attributes: {},
5240
5240
  children: []
5241
5241
  }, pe = ee ? !1 : o.options.filter(ie) === !1;
5242
- for (; !(J() || re(">") || re("?>") || re("/>")); ) {
5242
+ for (; !(Z() || re(">") || re("?>") || re("/>")); ) {
5243
5243
  const Re = H();
5244
5244
  if (Re)
5245
5245
  ie.attributes[Re.name] = Re.value;
@@ -5338,7 +5338,7 @@ function di() {
5338
5338
  if (Y)
5339
5339
  return o.xml = o.xml.slice(Y[0].length), Y;
5340
5340
  }
5341
- function J() {
5341
+ function Z() {
5342
5342
  return o.xml.length === 0;
5343
5343
  }
5344
5344
  function re(ee) {
@@ -5380,29 +5380,29 @@ function hi() {
5380
5380
  function y(M, F) {
5381
5381
  M.content += F;
5382
5382
  }
5383
- function b(M, F, J) {
5383
+ function b(M, F, Z) {
5384
5384
  if (M.type === "Element")
5385
- q(M, F, J);
5385
+ q(M, F, Z);
5386
5386
  else if (M.type === "ProcessingInstruction")
5387
5387
  z(M, F);
5388
5388
  else if (typeof M.content == "string")
5389
- R(M.content, F, J);
5389
+ R(M.content, F, Z);
5390
5390
  else
5391
5391
  throw new Error("Unknown node type: " + M.type);
5392
5392
  }
5393
- function R(M, F, J) {
5394
- if (!J) {
5393
+ function R(M, F, Z) {
5394
+ if (!Z) {
5395
5395
  const re = M.trim();
5396
5396
  (F.options.lineSeparator || re.length === 0) && (M = re);
5397
5397
  }
5398
- M.length > 0 && (!J && F.content.length > 0 && h(F), y(F, M));
5398
+ M.length > 0 && (!Z && F.content.length > 0 && h(F), y(F, M));
5399
5399
  }
5400
5400
  function P(M, F) {
5401
- const J = "/" + M.join("/"), re = M[M.length - 1];
5402
- return F.includes(re) || F.includes(J);
5401
+ const Z = "/" + M.join("/"), re = M[M.length - 1];
5402
+ return F.includes(re) || F.includes(Z);
5403
5403
  }
5404
- function q(M, F, J) {
5405
- if (F.path.push(M.name), !J && F.content.length > 0 && h(F), y(F, "<" + M.name), V(F, M.attributes), M.children === null || F.options.forceSelfClosingEmptyTag && M.children.length === 0) {
5404
+ function q(M, F, Z) {
5405
+ if (F.path.push(M.name), !Z && F.content.length > 0 && h(F), y(F, "<" + M.name), V(F, M.attributes), M.children === null || F.options.forceSelfClosingEmptyTag && M.children.length === 0) {
5406
5406
  const re = F.options.whiteSpaceAtEndOfSelfclosingTag ? " />" : "/>";
5407
5407
  y(F, re);
5408
5408
  } else if (M.children.length === 0)
@@ -5410,24 +5410,24 @@ function hi() {
5410
5410
  else {
5411
5411
  const re = M.children;
5412
5412
  y(F, ">"), F.level++;
5413
- let ye = M.attributes["xml:space"] === "preserve" || J, ee = !1;
5413
+ let ye = M.attributes["xml:space"] === "preserve" || Z, ee = !1;
5414
5414
  if (!ye && F.options.ignoredPaths && (ee = P(F.path, F.options.ignoredPaths), ye = ee), !ye && F.options.collapseContent) {
5415
5415
  let Y = !1, ie = !1, pe = !1;
5416
5416
  re.forEach(function(oe, Re) {
5417
5417
  oe.type === "Text" ? (oe.content.includes(`
5418
- `) ? (ie = !0, oe.content = oe.content.trim()) : (Re === 0 || Re === re.length - 1) && !J && oe.content.trim().length === 0 && (oe.content = ""), (oe.content.trim().length > 0 || re.length === 1) && (Y = !0)) : oe.type === "CDATA" ? Y = !0 : pe = !0;
5418
+ `) ? (ie = !0, oe.content = oe.content.trim()) : (Re === 0 || Re === re.length - 1) && !Z && oe.content.trim().length === 0 && (oe.content = ""), (oe.content.trim().length > 0 || re.length === 1) && (Y = !0)) : oe.type === "CDATA" ? Y = !0 : pe = !0;
5419
5419
  }), Y && (!pe || !ie) && (ye = !0);
5420
5420
  }
5421
5421
  re.forEach(function(Y) {
5422
- b(Y, F, J || ye);
5423
- }), F.level--, !J && !ye && h(F), ee && m(F), y(F, "</" + M.name + ">");
5422
+ b(Y, F, Z || ye);
5423
+ }), F.level--, !Z && !ye && h(F), ee && m(F), y(F, "</" + M.name + ">");
5424
5424
  }
5425
5425
  F.path.pop();
5426
5426
  }
5427
5427
  function V(M, F) {
5428
- Object.keys(F).forEach(function(J) {
5429
- const re = F[J].replace(/"/g, "&quot;");
5430
- y(M, " " + J + '="' + re + '"');
5428
+ Object.keys(F).forEach(function(Z) {
5429
+ const re = F[Z].replace(/"/g, "&quot;");
5430
+ y(M, " " + Z + '="' + re + '"');
5431
5431
  });
5432
5432
  }
5433
5433
  function z(M, F) {
@@ -5437,14 +5437,14 @@ function hi() {
5437
5437
  F.indentation = "indentation" in F ? F.indentation : " ", F.collapseContent = F.collapseContent === !0, F.lineSeparator = "lineSeparator" in F ? F.lineSeparator : `\r
5438
5438
  `, F.whiteSpaceAtEndOfSelfclosingTag = F.whiteSpaceAtEndOfSelfclosingTag === !0, F.throwOnFailure = F.throwOnFailure !== !1;
5439
5439
  try {
5440
- const J = (0, o.default)(M, { filter: F.filter, strictMode: F.strictMode }), re = { content: "", level: 0, options: F, path: [] };
5441
- return J.declaration && z(J.declaration, re), J.children.forEach(function(ye) {
5440
+ const Z = (0, o.default)(M, { filter: F.filter, strictMode: F.strictMode }), re = { content: "", level: 0, options: F, path: [] };
5441
+ return Z.declaration && z(Z.declaration, re), Z.children.forEach(function(ye) {
5442
5442
  b(ye, re, !1);
5443
5443
  }), F.lineSeparator ? re.content.replace(/\r\n/g, `
5444
5444
  `).replace(/\n/g, F.lineSeparator) : re.content;
5445
- } catch (J) {
5445
+ } catch (Z) {
5446
5446
  if (F.throwOnFailure)
5447
- throw J;
5447
+ throw Z;
5448
5448
  return M;
5449
5449
  }
5450
5450
  }
@@ -6212,7 +6212,7 @@ function Qi(l) {
6212
6212
  value: P
6213
6213
  },
6214
6214
  dialecteConfig: o
6215
- }), { childRecord: F, updatedParent: J } = Hi({
6215
+ }), { childRecord: F, updatedParent: Z } = Hi({
6216
6216
  record: M,
6217
6217
  context: H,
6218
6218
  dialecteConfig: o
@@ -6222,7 +6222,7 @@ function Qi(l) {
6222
6222
  currentFocus: F
6223
6223
  } : {
6224
6224
  ...H,
6225
- currentFocus: J
6225
+ currentFocus: Z
6226
6226
  };
6227
6227
  } catch (M) {
6228
6228
  const F = Ta({
@@ -6299,18 +6299,18 @@ function Zi(l) {
6299
6299
  });
6300
6300
  async function V(z) {
6301
6301
  const { chain: H, childRecord: M } = z;
6302
- let F = !0, J = M, re = H;
6303
- if (o.hooks?.beforeClone && ({ shouldBeCloned: F, transformedRecord: J } = o.hooks.beforeClone({
6304
- record: J
6302
+ let F = !0, Z = M, re = H;
6303
+ if (o.hooks?.beforeClone && ({ shouldBeCloned: F, transformedRecord: Z } = o.hooks.beforeClone({
6304
+ record: Z
6305
6305
  })), F) {
6306
6306
  re = H.addChild({
6307
- tagName: M.tagName,
6308
- namespace: M.namespace,
6309
- attributes: M.attributes,
6310
- value: M.value,
6307
+ tagName: Z.tagName,
6308
+ namespace: Z.namespace,
6309
+ attributes: Z.attributes,
6310
+ value: Z.value,
6311
6311
  setFocus: !0
6312
6312
  });
6313
- for (const ee of M.tree)
6313
+ for (const ee of Z.tree)
6314
6314
  re = await V({ chain: re, childRecord: ee }), re = re.goToParent();
6315
6315
  }
6316
6316
  return re;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialecte/core",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Dialecte - Core functionality for Dialecte SDK",
5
5
  "license": "MIT",
6
6
  "repository": {