@ms-cloudpack/remote-cache 0.11.11 → 0.11.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AzureRemoteCacheClient-WA46BODG.js → AzureRemoteCacheClient-P5SKY6OI.js} +2 -2
- package/dist/{chunk-LEHUXQFL.js → chunk-F6DB4LDZ.js} +10 -10
- package/dist/{chunk-B4Q7L4W6.js → chunk-IRFI44GC.js} +320 -327
- package/dist/{getCredential-JMWHVVNM.js → getCredential-IVB4UT3M.js} +190 -135
- package/dist/index.js +5 -5
- package/package.json +4 -4
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
require_commonjs5,
|
|
14
14
|
require_commonjs6,
|
|
15
15
|
tslib_es6_exports
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-F6DB4LDZ.js";
|
|
17
17
|
import {
|
|
18
18
|
__commonJS,
|
|
19
19
|
__name,
|
|
@@ -745,9 +745,9 @@ var require_commonjs8 = __commonJS({
|
|
|
745
745
|
}
|
|
746
746
|
});
|
|
747
747
|
|
|
748
|
-
// ../../node_modules/.store/fast-xml-parser-npm-5.2.
|
|
748
|
+
// ../../node_modules/.store/fast-xml-parser-npm-5.2.3-1f65097d09/package/lib/fxp.cjs
|
|
749
749
|
var require_fxp = __commonJS({
|
|
750
|
-
"../../node_modules/.store/fast-xml-parser-npm-5.2.
|
|
750
|
+
"../../node_modules/.store/fast-xml-parser-npm-5.2.3-1f65097d09/package/lib/fxp.cjs"(exports, module) {
|
|
751
751
|
(() => {
|
|
752
752
|
"use strict";
|
|
753
753
|
var t = { d: /* @__PURE__ */ __name((e2, n2) => {
|
|
@@ -755,28 +755,28 @@ var require_fxp = __commonJS({
|
|
|
755
755
|
}, "d"), o: /* @__PURE__ */ __name((t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2), "o"), r: /* @__PURE__ */ __name((t2) => {
|
|
756
756
|
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t2, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t2, "__esModule", { value: true });
|
|
757
757
|
}, "r") }, e = {};
|
|
758
|
-
t.r(e), t.d(e, { XMLBuilder: /* @__PURE__ */ __name(() =>
|
|
758
|
+
t.r(e), t.d(e, { XMLBuilder: /* @__PURE__ */ __name(() => ft, "XMLBuilder"), XMLParser: /* @__PURE__ */ __name(() => st, "XMLParser"), XMLValidator: /* @__PURE__ */ __name(() => mt, "XMLValidator") });
|
|
759
759
|
const n = ":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", i = new RegExp("^[" + n + "][" + n + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");
|
|
760
|
-
function
|
|
760
|
+
function s(t2, e2) {
|
|
761
761
|
const n2 = [];
|
|
762
762
|
let i2 = e2.exec(t2);
|
|
763
763
|
for (; i2; ) {
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
for (let t3 = 0; t3 <
|
|
768
|
-
n2.push(
|
|
764
|
+
const s2 = [];
|
|
765
|
+
s2.startIndex = e2.lastIndex - i2[0].length;
|
|
766
|
+
const r2 = i2.length;
|
|
767
|
+
for (let t3 = 0; t3 < r2; t3++) s2.push(i2[t3]);
|
|
768
|
+
n2.push(s2), i2 = e2.exec(t2);
|
|
769
769
|
}
|
|
770
770
|
return n2;
|
|
771
771
|
}
|
|
772
|
-
__name(
|
|
773
|
-
const
|
|
772
|
+
__name(s, "s");
|
|
773
|
+
const r = /* @__PURE__ */ __name(function(t2) {
|
|
774
774
|
return !(null == i.exec(t2));
|
|
775
|
-
}, "
|
|
775
|
+
}, "r"), o = { allowBooleanAttributes: false, unpairedTags: [] };
|
|
776
776
|
function a(t2, e2) {
|
|
777
777
|
e2 = Object.assign({}, o, e2);
|
|
778
778
|
const n2 = [];
|
|
779
|
-
let i2 = false,
|
|
779
|
+
let i2 = false, s2 = false;
|
|
780
780
|
"\uFEFF" === t2[0] && (t2 = t2.substr(1));
|
|
781
781
|
for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) {
|
|
782
782
|
if (o2 += 2, o2 = u(t2, o2), o2.err) return o2;
|
|
@@ -794,38 +794,38 @@ var require_fxp = __commonJS({
|
|
|
794
794
|
{
|
|
795
795
|
let d2 = false;
|
|
796
796
|
"/" === t2[o2] && (d2 = true, o2++);
|
|
797
|
-
let
|
|
798
|
-
for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++)
|
|
799
|
-
if (
|
|
797
|
+
let f2 = "";
|
|
798
|
+
for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) f2 += t2[o2];
|
|
799
|
+
if (f2 = f2.trim(), "/" === f2[f2.length - 1] && (f2 = f2.substring(0, f2.length - 1), o2--), !r(f2)) {
|
|
800
800
|
let e3;
|
|
801
|
-
return e3 = 0 ===
|
|
801
|
+
return e3 = 0 === f2.trim().length ? "Invalid space after '<'." : "Tag '" + f2 + "' is an invalid name.", x("InvalidTag", e3, N(t2, o2));
|
|
802
802
|
}
|
|
803
|
-
const p2 =
|
|
804
|
-
if (false === p2) return x("InvalidAttr", "Attributes for '" +
|
|
803
|
+
const p2 = c(t2, o2);
|
|
804
|
+
if (false === p2) return x("InvalidAttr", "Attributes for '" + f2 + "' have open quote.", N(t2, o2));
|
|
805
805
|
let b2 = p2.value;
|
|
806
806
|
if (o2 = p2.index, "/" === b2[b2.length - 1]) {
|
|
807
807
|
const n3 = o2 - b2.length;
|
|
808
808
|
b2 = b2.substring(0, b2.length - 1);
|
|
809
|
-
const
|
|
810
|
-
if (true !==
|
|
809
|
+
const s3 = g(b2, e2);
|
|
810
|
+
if (true !== s3) return x(s3.err.code, s3.err.msg, N(t2, n3 + s3.err.line));
|
|
811
811
|
i2 = true;
|
|
812
812
|
} else if (d2) {
|
|
813
|
-
if (!p2.tagClosed) return x("InvalidTag", "Closing tag '" +
|
|
814
|
-
if (b2.trim().length > 0) return x("InvalidTag", "Closing tag '" +
|
|
815
|
-
if (0 === n2.length) return x("InvalidTag", "Closing tag '" +
|
|
813
|
+
if (!p2.tagClosed) return x("InvalidTag", "Closing tag '" + f2 + "' doesn't have proper closing.", N(t2, o2));
|
|
814
|
+
if (b2.trim().length > 0) return x("InvalidTag", "Closing tag '" + f2 + "' can't have attributes or invalid starting.", N(t2, a2));
|
|
815
|
+
if (0 === n2.length) return x("InvalidTag", "Closing tag '" + f2 + "' has not been opened.", N(t2, a2));
|
|
816
816
|
{
|
|
817
817
|
const e3 = n2.pop();
|
|
818
|
-
if (
|
|
818
|
+
if (f2 !== e3.tagName) {
|
|
819
819
|
let n3 = N(t2, e3.tagStartPos);
|
|
820
|
-
return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" +
|
|
820
|
+
return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + n3.line + ", col " + n3.col + ") instead of closing tag '" + f2 + "'.", N(t2, a2));
|
|
821
821
|
}
|
|
822
|
-
0 == n2.length && (
|
|
822
|
+
0 == n2.length && (s2 = true);
|
|
823
823
|
}
|
|
824
824
|
} else {
|
|
825
|
-
const
|
|
826
|
-
if (true !==
|
|
827
|
-
if (true ===
|
|
828
|
-
-1 !== e2.unpairedTags.indexOf(
|
|
825
|
+
const r2 = g(b2, e2);
|
|
826
|
+
if (true !== r2) return x(r2.err.code, r2.err.msg, N(t2, o2 - b2.length + r2.err.line));
|
|
827
|
+
if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", N(t2, o2));
|
|
828
|
+
-1 !== e2.unpairedTags.indexOf(f2) || n2.push({ tagName: f2, tagStartPos: a2 }), i2 = true;
|
|
829
829
|
}
|
|
830
830
|
for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) {
|
|
831
831
|
if ("!" === t2[o2 + 1]) {
|
|
@@ -838,7 +838,7 @@ var require_fxp = __commonJS({
|
|
|
838
838
|
const e3 = m(t2, o2);
|
|
839
839
|
if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", N(t2, o2));
|
|
840
840
|
o2 = e3;
|
|
841
|
-
} else if (true ===
|
|
841
|
+
} else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", N(t2, o2));
|
|
842
842
|
"<" === t2[o2] && o2--;
|
|
843
843
|
}
|
|
844
844
|
}
|
|
@@ -883,31 +883,31 @@ var require_fxp = __commonJS({
|
|
|
883
883
|
return e2;
|
|
884
884
|
}
|
|
885
885
|
__name(h, "h");
|
|
886
|
-
const d = '"',
|
|
887
|
-
function
|
|
888
|
-
let n2 = "", i2 = "",
|
|
886
|
+
const d = '"', f = "'";
|
|
887
|
+
function c(t2, e2) {
|
|
888
|
+
let n2 = "", i2 = "", s2 = false;
|
|
889
889
|
for (; e2 < t2.length; e2++) {
|
|
890
|
-
if (t2[e2] === d || t2[e2] ===
|
|
890
|
+
if (t2[e2] === d || t2[e2] === f) "" === i2 ? i2 = t2[e2] : i2 !== t2[e2] || (i2 = "");
|
|
891
891
|
else if (">" === t2[e2] && "" === i2) {
|
|
892
|
-
|
|
892
|
+
s2 = true;
|
|
893
893
|
break;
|
|
894
894
|
}
|
|
895
895
|
n2 += t2[e2];
|
|
896
896
|
}
|
|
897
|
-
return "" === i2 && { value: n2, index: e2, tagClosed:
|
|
897
|
+
return "" === i2 && { value: n2, index: e2, tagClosed: s2 };
|
|
898
898
|
}
|
|
899
|
-
__name(
|
|
899
|
+
__name(c, "c");
|
|
900
900
|
const p = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
|
|
901
901
|
function g(t2, e2) {
|
|
902
|
-
const n2 =
|
|
902
|
+
const n2 = s(t2, p), i2 = {};
|
|
903
903
|
for (let t3 = 0; t3 < n2.length; t3++) {
|
|
904
904
|
if (0 === n2[t3][1].length) return x("InvalidAttr", "Attribute '" + n2[t3][2] + "' has no space in starting.", E(n2[t3]));
|
|
905
905
|
if (void 0 !== n2[t3][3] && void 0 === n2[t3][4]) return x("InvalidAttr", "Attribute '" + n2[t3][2] + "' is without value.", E(n2[t3]));
|
|
906
906
|
if (void 0 === n2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + n2[t3][2] + "' is not allowed.", E(n2[t3]));
|
|
907
|
-
const
|
|
908
|
-
if (!b(
|
|
909
|
-
if (i2.hasOwnProperty(
|
|
910
|
-
i2[
|
|
907
|
+
const s2 = n2[t3][2];
|
|
908
|
+
if (!b(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(n2[t3]));
|
|
909
|
+
if (i2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(n2[t3]));
|
|
910
|
+
i2[s2] = 1;
|
|
911
911
|
}
|
|
912
912
|
return true;
|
|
913
913
|
}
|
|
@@ -935,7 +935,7 @@ var require_fxp = __commonJS({
|
|
|
935
935
|
}
|
|
936
936
|
__name(x, "x");
|
|
937
937
|
function b(t2) {
|
|
938
|
-
return
|
|
938
|
+
return r(t2);
|
|
939
939
|
}
|
|
940
940
|
__name(b, "b");
|
|
941
941
|
function N(t2, e2) {
|
|
@@ -977,26 +977,26 @@ var require_fxp = __commonJS({
|
|
|
977
977
|
if ("O" !== t2[e2 + 3] || "C" !== t2[e2 + 4] || "T" !== t2[e2 + 5] || "Y" !== t2[e2 + 6] || "P" !== t2[e2 + 7] || "E" !== t2[e2 + 8]) throw new Error("Invalid Tag instead of DOCTYPE");
|
|
978
978
|
{
|
|
979
979
|
e2 += 9;
|
|
980
|
-
let i2 = 1,
|
|
981
|
-
for (; e2 < t2.length; e2++) if ("<" !== t2[e2] ||
|
|
982
|
-
if (
|
|
983
|
-
} else "[" === t2[e2] ?
|
|
980
|
+
let i2 = 1, s2 = false, r2 = false, o2 = "";
|
|
981
|
+
for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) {
|
|
982
|
+
if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, i2--) : i2--, 0 === i2) break;
|
|
983
|
+
} else "[" === t2[e2] ? s2 = true : o2 += t2[e2];
|
|
984
984
|
else {
|
|
985
|
-
if (
|
|
986
|
-
let i3,
|
|
987
|
-
e2 += 7, [i3,
|
|
988
|
-
} else if (
|
|
985
|
+
if (s2 && C(t2, "!ENTITY", e2)) {
|
|
986
|
+
let i3, s3;
|
|
987
|
+
e2 += 7, [i3, s3, e2] = O(t2, e2 + 1), -1 === s3.indexOf("&") && (n2[i3] = { regx: RegExp(`&${i3};`, "g"), val: s3 });
|
|
988
|
+
} else if (s2 && C(t2, "!ELEMENT", e2)) {
|
|
989
989
|
e2 += 8;
|
|
990
990
|
const { index: n3 } = S(t2, e2 + 1);
|
|
991
991
|
e2 = n3;
|
|
992
|
-
} else if (
|
|
993
|
-
else if (
|
|
992
|
+
} else if (s2 && C(t2, "!ATTLIST", e2)) e2 += 8;
|
|
993
|
+
else if (s2 && C(t2, "!NOTATION", e2)) {
|
|
994
994
|
e2 += 9;
|
|
995
995
|
const { index: n3 } = A(t2, e2 + 1);
|
|
996
996
|
e2 = n3;
|
|
997
997
|
} else {
|
|
998
|
-
if (!C) throw new Error("Invalid DOCTYPE");
|
|
999
|
-
|
|
998
|
+
if (!C(t2, "!--", e2)) throw new Error("Invalid DOCTYPE");
|
|
999
|
+
r2 = true;
|
|
1000
1000
|
}
|
|
1001
1001
|
i2++, o2 = "";
|
|
1002
1002
|
}
|
|
@@ -1013,7 +1013,7 @@ var require_fxp = __commonJS({
|
|
|
1013
1013
|
e2 = P(t2, e2);
|
|
1014
1014
|
let n2 = "";
|
|
1015
1015
|
for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) n2 += t2[e2], e2++;
|
|
1016
|
-
if (
|
|
1016
|
+
if ($(n2), e2 = P(t2, e2), "SYSTEM" === t2.substring(e2, e2 + 6).toUpperCase()) throw new Error("External entities are not supported");
|
|
1017
1017
|
if ("%" === t2[e2]) throw new Error("Parameter entities are not supported");
|
|
1018
1018
|
let i2 = "";
|
|
1019
1019
|
return [e2, i2] = I(t2, e2, "entity"), [n2, i2, --e2];
|
|
@@ -1023,22 +1023,22 @@ var require_fxp = __commonJS({
|
|
|
1023
1023
|
e2 = P(t2, e2);
|
|
1024
1024
|
let n2 = "";
|
|
1025
1025
|
for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++;
|
|
1026
|
-
|
|
1026
|
+
$(n2), e2 = P(t2, e2);
|
|
1027
1027
|
const i2 = t2.substring(e2, e2 + 6).toUpperCase();
|
|
1028
1028
|
if ("SYSTEM" !== i2 && "PUBLIC" !== i2) throw new Error(`Expected SYSTEM or PUBLIC, found "${i2}"`);
|
|
1029
1029
|
e2 += i2.length, e2 = P(t2, e2);
|
|
1030
|
-
let
|
|
1031
|
-
if ("PUBLIC" === i2) [e2,
|
|
1032
|
-
else if ("SYSTEM" === i2 && ([e2,
|
|
1033
|
-
return { notationName: n2, publicIdentifier:
|
|
1030
|
+
let s2 = null, r2 = null;
|
|
1031
|
+
if ("PUBLIC" === i2) [e2, s2] = I(t2, e2, "publicIdentifier"), '"' !== t2[e2 = P(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = I(t2, e2, "systemIdentifier"));
|
|
1032
|
+
else if ("SYSTEM" === i2 && ([e2, r2] = I(t2, e2, "systemIdentifier"), !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation");
|
|
1033
|
+
return { notationName: n2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 };
|
|
1034
1034
|
}
|
|
1035
1035
|
__name(A, "A");
|
|
1036
1036
|
function I(t2, e2, n2) {
|
|
1037
1037
|
let i2 = "";
|
|
1038
|
-
const
|
|
1039
|
-
if ('"' !==
|
|
1040
|
-
for (e2++; e2 < t2.length && t2[e2] !==
|
|
1041
|
-
if (t2[e2] !==
|
|
1038
|
+
const s2 = t2[e2];
|
|
1039
|
+
if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`);
|
|
1040
|
+
for (e2++; e2 < t2.length && t2[e2] !== s2; ) i2 += t2[e2], e2++;
|
|
1041
|
+
if (t2[e2] !== s2) throw new Error(`Unterminated ${n2} value`);
|
|
1042
1042
|
return [++e2, i2];
|
|
1043
1043
|
}
|
|
1044
1044
|
__name(I, "I");
|
|
@@ -1046,42 +1046,31 @@ var require_fxp = __commonJS({
|
|
|
1046
1046
|
e2 = P(t2, e2);
|
|
1047
1047
|
let n2 = "";
|
|
1048
1048
|
for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++;
|
|
1049
|
-
if (
|
|
1050
|
-
if ("(" !== t2[e2 = P(t2, e2)]) throw new Error(`Expected '(', found "${t2[e2]}"`);
|
|
1051
|
-
e2++;
|
|
1049
|
+
if (!$(n2)) throw new Error(`Invalid element name: "${n2}"`);
|
|
1052
1050
|
let i2 = "";
|
|
1053
|
-
|
|
1054
|
-
if ("
|
|
1051
|
+
if ("E" === t2[e2 = P(t2, e2)] && C(t2, "MPTY", e2)) e2 += 6;
|
|
1052
|
+
else if ("A" === t2[e2] && C(t2, "NY", e2)) e2 += 4;
|
|
1053
|
+
else {
|
|
1054
|
+
if ("(" !== t2[e2]) throw new Error(`Invalid Element Expression, found "${t2[e2]}"`);
|
|
1055
|
+
for (e2++; e2 < t2.length && ")" !== t2[e2]; ) i2 += t2[e2], e2++;
|
|
1056
|
+
if (")" !== t2[e2]) throw new Error("Unterminated content model");
|
|
1057
|
+
}
|
|
1055
1058
|
return { elementName: n2, contentModel: i2.trim(), index: e2 };
|
|
1056
1059
|
}
|
|
1057
1060
|
__name(S, "S");
|
|
1058
|
-
function C(t2, e2) {
|
|
1059
|
-
|
|
1061
|
+
function C(t2, e2, n2) {
|
|
1062
|
+
for (let i2 = 0; i2 < e2.length; i2++) if (e2[i2] !== t2[n2 + i2 + 1]) return false;
|
|
1063
|
+
return true;
|
|
1060
1064
|
}
|
|
1061
1065
|
__name(C, "C");
|
|
1062
|
-
function $(t2
|
|
1063
|
-
|
|
1066
|
+
function $(t2) {
|
|
1067
|
+
if (r(t2)) return t2;
|
|
1068
|
+
throw new Error(`Invalid entity name ${t2}`);
|
|
1064
1069
|
}
|
|
1065
1070
|
__name($, "$");
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
}
|
|
1069
|
-
__name(j, "j");
|
|
1070
|
-
function D(t2, e2) {
|
|
1071
|
-
return "!" === t2[e2 + 1] && "A" === t2[e2 + 2] && "T" === t2[e2 + 3] && "T" === t2[e2 + 4] && "L" === t2[e2 + 5] && "I" === t2[e2 + 6] && "S" === t2[e2 + 7] && "T" === t2[e2 + 8];
|
|
1072
|
-
}
|
|
1073
|
-
__name(D, "D");
|
|
1074
|
-
function V(t2, e2) {
|
|
1075
|
-
return "!" === t2[e2 + 1] && "N" === t2[e2 + 2] && "O" === t2[e2 + 3] && "T" === t2[e2 + 4] && "A" === t2[e2 + 5] && "T" === t2[e2 + 6] && "I" === t2[e2 + 7] && "O" === t2[e2 + 8] && "N" === t2[e2 + 9];
|
|
1076
|
-
}
|
|
1077
|
-
__name(V, "V");
|
|
1071
|
+
const j = /^[-+]?0x[a-fA-F0-9]+$/, D = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true };
|
|
1072
|
+
const M = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
|
|
1078
1073
|
function _(t2) {
|
|
1079
|
-
if (s(t2)) return t2;
|
|
1080
|
-
throw new Error(`Invalid entity name ${t2}`);
|
|
1081
|
-
}
|
|
1082
|
-
__name(_, "_");
|
|
1083
|
-
const k = /^[-+]?0x[a-fA-F0-9]+$/, F = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, M = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true };
|
|
1084
|
-
function L(t2) {
|
|
1085
1074
|
return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => {
|
|
1086
1075
|
for (const n2 of t2) {
|
|
1087
1076
|
if ("string" == typeof n2 && e2 === n2) return true;
|
|
@@ -1089,31 +1078,31 @@ var require_fxp = __commonJS({
|
|
|
1089
1078
|
}
|
|
1090
1079
|
} : () => false;
|
|
1091
1080
|
}
|
|
1092
|
-
__name(
|
|
1093
|
-
const
|
|
1081
|
+
__name(_, "_");
|
|
1082
|
+
const _k = class _k {
|
|
1094
1083
|
constructor(t2) {
|
|
1095
|
-
this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: /* @__PURE__ */ __name((t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)), "val") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: /* @__PURE__ */ __name((t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)), "val") } }, this.addExternalEntities =
|
|
1084
|
+
this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: /* @__PURE__ */ __name((t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)), "val") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: /* @__PURE__ */ __name((t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)), "val") } }, this.addExternalEntities = F, this.parseXml = X, this.parseTextData = L, this.resolveNameSpace = B, this.buildAttributesMap = G, this.isItStopNode = Z, this.replaceEntitiesValue = R, this.readStopNodeData = J, this.saveTextToParentTag = q, this.addChild = Y, this.ignoreAttributesFn = _(this.options.ignoreAttributes);
|
|
1096
1085
|
}
|
|
1097
1086
|
};
|
|
1098
|
-
__name(
|
|
1099
|
-
let
|
|
1100
|
-
function
|
|
1087
|
+
__name(_k, "k");
|
|
1088
|
+
let k = _k;
|
|
1089
|
+
function F(t2) {
|
|
1101
1090
|
const e2 = Object.keys(t2);
|
|
1102
1091
|
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
1103
1092
|
const i2 = e2[n2];
|
|
1104
1093
|
this.lastEntities[i2] = { regex: new RegExp("&" + i2 + ";", "g"), val: t2[i2] };
|
|
1105
1094
|
}
|
|
1106
1095
|
}
|
|
1107
|
-
__name(
|
|
1108
|
-
function
|
|
1096
|
+
__name(F, "F");
|
|
1097
|
+
function L(t2, e2, n2, i2, s2, r2, o2) {
|
|
1109
1098
|
if (void 0 !== t2 && (this.options.trimValues && !i2 && (t2 = t2.trim()), t2.length > 0)) {
|
|
1110
1099
|
o2 || (t2 = this.replaceEntitiesValue(t2));
|
|
1111
|
-
const i3 = this.options.tagValueProcessor(e2, t2, n2,
|
|
1112
|
-
return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ?
|
|
1100
|
+
const i3 = this.options.tagValueProcessor(e2, t2, n2, s2, r2);
|
|
1101
|
+
return null == i3 ? t2 : typeof i3 != typeof t2 || i3 !== t2 ? i3 : this.options.trimValues || t2.trim() === t2 ? H(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2;
|
|
1113
1102
|
}
|
|
1114
1103
|
}
|
|
1115
|
-
__name(
|
|
1116
|
-
function
|
|
1104
|
+
__name(L, "L");
|
|
1105
|
+
function B(t2) {
|
|
1117
1106
|
if (this.options.removeNSPrefix) {
|
|
1118
1107
|
const e2 = t2.split(":"), n2 = "/" === t2.charAt(0) ? "/" : "";
|
|
1119
1108
|
if ("xmlns" === e2[0]) return "";
|
|
@@ -1121,111 +1110,111 @@ var require_fxp = __commonJS({
|
|
|
1121
1110
|
}
|
|
1122
1111
|
return t2;
|
|
1123
1112
|
}
|
|
1124
|
-
__name(
|
|
1125
|
-
const
|
|
1126
|
-
function
|
|
1113
|
+
__name(B, "B");
|
|
1114
|
+
const U = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
|
|
1115
|
+
function G(t2, e2, n2) {
|
|
1127
1116
|
if (true !== this.options.ignoreAttributes && "string" == typeof t2) {
|
|
1128
|
-
const n3 =
|
|
1117
|
+
const n3 = s(t2, U), i2 = n3.length, r2 = {};
|
|
1129
1118
|
for (let t3 = 0; t3 < i2; t3++) {
|
|
1130
1119
|
const i3 = this.resolveNameSpace(n3[t3][1]);
|
|
1131
1120
|
if (this.ignoreAttributesFn(i3, e2)) continue;
|
|
1132
|
-
let
|
|
1133
|
-
if (i3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !==
|
|
1134
|
-
this.options.trimValues && (
|
|
1135
|
-
const t4 = this.options.attributeValueProcessor(i3,
|
|
1136
|
-
|
|
1137
|
-
} else this.options.allowBooleanAttributes && (
|
|
1138
|
-
}
|
|
1139
|
-
if (!Object.keys(
|
|
1121
|
+
let s2 = n3[t3][4], o2 = this.options.attributeNamePrefix + i3;
|
|
1122
|
+
if (i3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) {
|
|
1123
|
+
this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2);
|
|
1124
|
+
const t4 = this.options.attributeValueProcessor(i3, s2, e2);
|
|
1125
|
+
r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : H(s2, this.options.parseAttributeValue, this.options.numberParseOptions);
|
|
1126
|
+
} else this.options.allowBooleanAttributes && (r2[o2] = true);
|
|
1127
|
+
}
|
|
1128
|
+
if (!Object.keys(r2).length) return;
|
|
1140
1129
|
if (this.options.attributesGroupName) {
|
|
1141
1130
|
const t3 = {};
|
|
1142
|
-
return t3[this.options.attributesGroupName] =
|
|
1131
|
+
return t3[this.options.attributesGroupName] = r2, t3;
|
|
1143
1132
|
}
|
|
1144
|
-
return
|
|
1133
|
+
return r2;
|
|
1145
1134
|
}
|
|
1146
1135
|
}
|
|
1147
|
-
__name(
|
|
1148
|
-
const
|
|
1136
|
+
__name(G, "G");
|
|
1137
|
+
const X = /* @__PURE__ */ __name(function(t2) {
|
|
1149
1138
|
t2 = t2.replace(/\r\n?/g, "\n");
|
|
1150
1139
|
const e2 = new T("!xml");
|
|
1151
|
-
let n2 = e2, i2 = "",
|
|
1152
|
-
for (let
|
|
1153
|
-
const e3 =
|
|
1154
|
-
let o2 = t2.substring(
|
|
1140
|
+
let n2 = e2, i2 = "", s2 = "";
|
|
1141
|
+
for (let r2 = 0; r2 < t2.length; r2++) if ("<" === t2[r2]) if ("/" === t2[r2 + 1]) {
|
|
1142
|
+
const e3 = W(t2, ">", r2, "Closing Tag is not closed.");
|
|
1143
|
+
let o2 = t2.substring(r2 + 2, e3).trim();
|
|
1155
1144
|
if (this.options.removeNSPrefix) {
|
|
1156
1145
|
const t3 = o2.indexOf(":");
|
|
1157
1146
|
-1 !== t3 && (o2 = o2.substr(t3 + 1));
|
|
1158
1147
|
}
|
|
1159
|
-
this.options.transformTagName && (o2 = this.options.transformTagName(o2)), n2 && (i2 = this.saveTextToParentTag(i2, n2,
|
|
1160
|
-
const a2 =
|
|
1148
|
+
this.options.transformTagName && (o2 = this.options.transformTagName(o2)), n2 && (i2 = this.saveTextToParentTag(i2, n2, s2));
|
|
1149
|
+
const a2 = s2.substring(s2.lastIndexOf(".") + 1);
|
|
1161
1150
|
if (o2 && -1 !== this.options.unpairedTags.indexOf(o2)) throw new Error(`Unpaired tag can not be used as closing tag: </${o2}>`);
|
|
1162
1151
|
let l2 = 0;
|
|
1163
|
-
a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 =
|
|
1164
|
-
} else if ("?" === t2[
|
|
1165
|
-
let e3 =
|
|
1152
|
+
a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), n2 = this.tagsNodeStack.pop(), i2 = "", r2 = e3;
|
|
1153
|
+
} else if ("?" === t2[r2 + 1]) {
|
|
1154
|
+
let e3 = z(t2, r2, false, "?>");
|
|
1166
1155
|
if (!e3) throw new Error("Pi Tag is not closed.");
|
|
1167
|
-
if (i2 = this.saveTextToParentTag(i2, n2,
|
|
1156
|
+
if (i2 = this.saveTextToParentTag(i2, n2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ;
|
|
1168
1157
|
else {
|
|
1169
1158
|
const t3 = new T(e3.tagName);
|
|
1170
|
-
t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp,
|
|
1159
|
+
t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2, e3.tagName)), this.addChild(n2, t3, s2, r2);
|
|
1171
1160
|
}
|
|
1172
|
-
|
|
1173
|
-
} else if ("!--" === t2.substr(
|
|
1174
|
-
const e3 =
|
|
1161
|
+
r2 = e3.closeIndex + 1;
|
|
1162
|
+
} else if ("!--" === t2.substr(r2 + 1, 3)) {
|
|
1163
|
+
const e3 = W(t2, "-->", r2 + 4, "Comment is not closed.");
|
|
1175
1164
|
if (this.options.commentPropName) {
|
|
1176
|
-
const o2 = t2.substring(
|
|
1177
|
-
i2 = this.saveTextToParentTag(i2, n2,
|
|
1178
|
-
}
|
|
1179
|
-
|
|
1180
|
-
} else if ("!D" === t2.substr(
|
|
1181
|
-
const e3 = w(t2,
|
|
1182
|
-
this.docTypeEntities = e3.entities,
|
|
1183
|
-
} else if ("![" === t2.substr(
|
|
1184
|
-
const e3 =
|
|
1185
|
-
i2 = this.saveTextToParentTag(i2, n2,
|
|
1186
|
-
let a2 = this.parseTextData(o2, n2.tagname,
|
|
1187
|
-
null == a2 && (a2 = ""), this.options.cdataPropName ? n2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o2 }]) : n2.add(this.options.textNodeName, a2),
|
|
1165
|
+
const o2 = t2.substring(r2 + 4, e3 - 2);
|
|
1166
|
+
i2 = this.saveTextToParentTag(i2, n2, s2), n2.add(this.options.commentPropName, [{ [this.options.textNodeName]: o2 }]);
|
|
1167
|
+
}
|
|
1168
|
+
r2 = e3;
|
|
1169
|
+
} else if ("!D" === t2.substr(r2 + 1, 2)) {
|
|
1170
|
+
const e3 = w(t2, r2);
|
|
1171
|
+
this.docTypeEntities = e3.entities, r2 = e3.i;
|
|
1172
|
+
} else if ("![" === t2.substr(r2 + 1, 2)) {
|
|
1173
|
+
const e3 = W(t2, "]]>", r2, "CDATA is not closed.") - 2, o2 = t2.substring(r2 + 9, e3);
|
|
1174
|
+
i2 = this.saveTextToParentTag(i2, n2, s2);
|
|
1175
|
+
let a2 = this.parseTextData(o2, n2.tagname, s2, true, false, true, true);
|
|
1176
|
+
null == a2 && (a2 = ""), this.options.cdataPropName ? n2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o2 }]) : n2.add(this.options.textNodeName, a2), r2 = e3 + 2;
|
|
1188
1177
|
} else {
|
|
1189
|
-
let o2 =
|
|
1178
|
+
let o2 = z(t2, r2, this.options.removeNSPrefix), a2 = o2.tagName;
|
|
1190
1179
|
const l2 = o2.rawTagName;
|
|
1191
1180
|
let u2 = o2.tagExp, h2 = o2.attrExpPresent, d2 = o2.closeIndex;
|
|
1192
|
-
this.options.transformTagName && (a2 = this.options.transformTagName(a2)), n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2,
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1195
|
-
const
|
|
1196
|
-
if (this.isItStopNode(this.options.stopNodes,
|
|
1181
|
+
this.options.transformTagName && (a2 = this.options.transformTagName(a2)), n2 && i2 && "!xml" !== n2.tagname && (i2 = this.saveTextToParentTag(i2, n2, s2, false));
|
|
1182
|
+
const f2 = n2;
|
|
1183
|
+
f2 && -1 !== this.options.unpairedTags.indexOf(f2.tagname) && (n2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2);
|
|
1184
|
+
const c2 = r2;
|
|
1185
|
+
if (this.isItStopNode(this.options.stopNodes, s2, a2)) {
|
|
1197
1186
|
let e3 = "";
|
|
1198
|
-
if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1),
|
|
1199
|
-
else if (-1 !== this.options.unpairedTags.indexOf(a2))
|
|
1187
|
+
if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), r2 = o2.closeIndex;
|
|
1188
|
+
else if (-1 !== this.options.unpairedTags.indexOf(a2)) r2 = o2.closeIndex;
|
|
1200
1189
|
else {
|
|
1201
1190
|
const n3 = this.readStopNodeData(t2, l2, d2 + 1);
|
|
1202
1191
|
if (!n3) throw new Error(`Unexpected end of ${l2}`);
|
|
1203
|
-
|
|
1192
|
+
r2 = n3.i, e3 = n3.tagContent;
|
|
1204
1193
|
}
|
|
1205
1194
|
const i3 = new T(a2);
|
|
1206
|
-
a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2,
|
|
1195
|
+
a2 !== u2 && h2 && (i3[":@"] = this.buildAttributesMap(u2, s2, a2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), i3.add(this.options.textNodeName, e3), this.addChild(n2, i3, s2, c2);
|
|
1207
1196
|
} else {
|
|
1208
1197
|
if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) {
|
|
1209
|
-
"/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1),
|
|
1198
|
+
"/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName && (a2 = this.options.transformTagName(a2));
|
|
1210
1199
|
const t3 = new T(a2);
|
|
1211
|
-
a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2,
|
|
1200
|
+
a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), s2 = s2.substr(0, s2.lastIndexOf("."));
|
|
1212
1201
|
} else {
|
|
1213
1202
|
const t3 = new T(a2);
|
|
1214
|
-
this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2,
|
|
1203
|
+
this.tagsNodeStack.push(n2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2, a2)), this.addChild(n2, t3, s2, c2), n2 = t3;
|
|
1215
1204
|
}
|
|
1216
|
-
i2 = "",
|
|
1205
|
+
i2 = "", r2 = d2;
|
|
1217
1206
|
}
|
|
1218
1207
|
}
|
|
1219
|
-
else i2 += t2[
|
|
1208
|
+
else i2 += t2[r2];
|
|
1220
1209
|
return e2.child;
|
|
1221
|
-
}, "
|
|
1222
|
-
function
|
|
1210
|
+
}, "X");
|
|
1211
|
+
function Y(t2, e2, n2, i2) {
|
|
1223
1212
|
this.options.captureMetaData || (i2 = void 0);
|
|
1224
|
-
const
|
|
1225
|
-
false ===
|
|
1213
|
+
const s2 = this.options.updateTag(e2.tagname, n2, e2[":@"]);
|
|
1214
|
+
false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, i2)) : t2.addChild(e2, i2));
|
|
1226
1215
|
}
|
|
1227
|
-
__name(
|
|
1228
|
-
const
|
|
1216
|
+
__name(Y, "Y");
|
|
1217
|
+
const R = /* @__PURE__ */ __name(function(t2) {
|
|
1229
1218
|
if (this.options.processEntities) {
|
|
1230
1219
|
for (let e2 in this.docTypeEntities) {
|
|
1231
1220
|
const n2 = this.docTypeEntities[e2];
|
|
@@ -1242,103 +1231,107 @@ var require_fxp = __commonJS({
|
|
|
1242
1231
|
t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val);
|
|
1243
1232
|
}
|
|
1244
1233
|
return t2;
|
|
1245
|
-
}, "
|
|
1246
|
-
function
|
|
1234
|
+
}, "R");
|
|
1235
|
+
function q(t2, e2, n2, i2) {
|
|
1247
1236
|
return t2 && (void 0 === i2 && (i2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, n2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, i2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2;
|
|
1248
1237
|
}
|
|
1249
|
-
__name(
|
|
1250
|
-
function
|
|
1238
|
+
__name(q, "q");
|
|
1239
|
+
function Z(t2, e2, n2) {
|
|
1251
1240
|
const i2 = "*." + n2;
|
|
1252
1241
|
for (const n3 in t2) {
|
|
1253
|
-
const
|
|
1254
|
-
if (i2 ===
|
|
1242
|
+
const s2 = t2[n3];
|
|
1243
|
+
if (i2 === s2 || e2 === s2) return true;
|
|
1255
1244
|
}
|
|
1256
1245
|
return false;
|
|
1257
1246
|
}
|
|
1258
|
-
__name(
|
|
1259
|
-
function
|
|
1260
|
-
const
|
|
1261
|
-
if (-1 ===
|
|
1262
|
-
return
|
|
1263
|
-
}
|
|
1264
|
-
__name(
|
|
1265
|
-
function
|
|
1266
|
-
const
|
|
1267
|
-
let i3,
|
|
1268
|
-
for (let
|
|
1269
|
-
let e4 = t3[
|
|
1247
|
+
__name(Z, "Z");
|
|
1248
|
+
function W(t2, e2, n2, i2) {
|
|
1249
|
+
const s2 = t2.indexOf(e2, n2);
|
|
1250
|
+
if (-1 === s2) throw new Error(i2);
|
|
1251
|
+
return s2 + e2.length - 1;
|
|
1252
|
+
}
|
|
1253
|
+
__name(W, "W");
|
|
1254
|
+
function z(t2, e2, n2, i2 = ">") {
|
|
1255
|
+
const s2 = function(t3, e3, n3 = ">") {
|
|
1256
|
+
let i3, s3 = "";
|
|
1257
|
+
for (let r3 = e3; r3 < t3.length; r3++) {
|
|
1258
|
+
let e4 = t3[r3];
|
|
1270
1259
|
if (i3) e4 === i3 && (i3 = "");
|
|
1271
1260
|
else if ('"' === e4 || "'" === e4) i3 = e4;
|
|
1272
1261
|
else if (e4 === n3[0]) {
|
|
1273
|
-
if (!n3[1]) return { data:
|
|
1274
|
-
if (t3[
|
|
1262
|
+
if (!n3[1]) return { data: s3, index: r3 };
|
|
1263
|
+
if (t3[r3 + 1] === n3[1]) return { data: s3, index: r3 };
|
|
1275
1264
|
} else " " === e4 && (e4 = " ");
|
|
1276
|
-
|
|
1265
|
+
s3 += e4;
|
|
1277
1266
|
}
|
|
1278
1267
|
}(t2, e2 + 1, i2);
|
|
1279
|
-
if (!
|
|
1280
|
-
let
|
|
1281
|
-
const o2 =
|
|
1282
|
-
let l2 =
|
|
1283
|
-
-1 !== a2 && (l2 =
|
|
1268
|
+
if (!s2) return;
|
|
1269
|
+
let r2 = s2.data;
|
|
1270
|
+
const o2 = s2.index, a2 = r2.search(/\s/);
|
|
1271
|
+
let l2 = r2, u2 = true;
|
|
1272
|
+
-1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart());
|
|
1284
1273
|
const h2 = l2;
|
|
1285
1274
|
if (n2) {
|
|
1286
1275
|
const t3 = l2.indexOf(":");
|
|
1287
|
-
-1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !==
|
|
1276
|
+
-1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1));
|
|
1288
1277
|
}
|
|
1289
|
-
return { tagName: l2, tagExp:
|
|
1278
|
+
return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 };
|
|
1290
1279
|
}
|
|
1291
|
-
__name(
|
|
1292
|
-
function
|
|
1280
|
+
__name(z, "z");
|
|
1281
|
+
function J(t2, e2, n2) {
|
|
1293
1282
|
const i2 = n2;
|
|
1294
|
-
let
|
|
1283
|
+
let s2 = 1;
|
|
1295
1284
|
for (; n2 < t2.length; n2++) if ("<" === t2[n2]) if ("/" === t2[n2 + 1]) {
|
|
1296
|
-
const
|
|
1297
|
-
if (t2.substring(n2 + 2,
|
|
1298
|
-
n2 =
|
|
1299
|
-
} else if ("?" === t2[n2 + 1]) n2 =
|
|
1300
|
-
else if ("!--" === t2.substr(n2 + 1, 3)) n2 =
|
|
1301
|
-
else if ("![" === t2.substr(n2 + 1, 2)) n2 =
|
|
1285
|
+
const r2 = W(t2, ">", n2, `${e2} is not closed`);
|
|
1286
|
+
if (t2.substring(n2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(i2, n2), i: r2 };
|
|
1287
|
+
n2 = r2;
|
|
1288
|
+
} else if ("?" === t2[n2 + 1]) n2 = W(t2, "?>", n2 + 1, "StopNode is not closed.");
|
|
1289
|
+
else if ("!--" === t2.substr(n2 + 1, 3)) n2 = W(t2, "-->", n2 + 3, "StopNode is not closed.");
|
|
1290
|
+
else if ("![" === t2.substr(n2 + 1, 2)) n2 = W(t2, "]]>", n2, "StopNode is not closed.") - 2;
|
|
1302
1291
|
else {
|
|
1303
|
-
const i3 =
|
|
1304
|
-
i3 && ((i3 && i3.tagName) === e2 && "/" !== i3.tagExp[i3.tagExp.length - 1] &&
|
|
1292
|
+
const i3 = z(t2, n2, ">");
|
|
1293
|
+
i3 && ((i3 && i3.tagName) === e2 && "/" !== i3.tagExp[i3.tagExp.length - 1] && s2++, n2 = i3.closeIndex);
|
|
1305
1294
|
}
|
|
1306
1295
|
}
|
|
1307
|
-
__name(
|
|
1308
|
-
function
|
|
1296
|
+
__name(J, "J");
|
|
1297
|
+
function H(t2, e2, n2) {
|
|
1309
1298
|
if (e2 && "string" == typeof t2) {
|
|
1310
1299
|
const e3 = t2.trim();
|
|
1311
1300
|
return "true" === e3 || "false" !== e3 && function(t3, e4 = {}) {
|
|
1312
|
-
if (e4 = Object.assign({},
|
|
1301
|
+
if (e4 = Object.assign({}, V, e4), !t3 || "string" != typeof t3) return t3;
|
|
1313
1302
|
let n3 = t3.trim();
|
|
1314
1303
|
if (void 0 !== e4.skipLike && e4.skipLike.test(n3)) return t3;
|
|
1315
1304
|
if ("0" === t3) return 0;
|
|
1316
|
-
if (e4.hex &&
|
|
1305
|
+
if (e4.hex && j.test(n3)) return function(t4) {
|
|
1317
1306
|
if (parseInt) return parseInt(t4, 16);
|
|
1318
1307
|
if (Number.parseInt) return Number.parseInt(t4, 16);
|
|
1319
1308
|
if (window && window.parseInt) return window.parseInt(t4, 16);
|
|
1320
1309
|
throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
|
|
1321
1310
|
}(n3);
|
|
1322
|
-
if (-1 !== n3.search(
|
|
1323
|
-
|
|
1311
|
+
if (-1 !== n3.search(/.+[eE].+/)) return function(t4, e5, n4) {
|
|
1312
|
+
if (!n4.eNotation) return t4;
|
|
1313
|
+
const i3 = e5.match(M);
|
|
1324
1314
|
if (i3) {
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
return
|
|
1315
|
+
let s2 = i3[1] || "";
|
|
1316
|
+
const r2 = -1 === i3[3].indexOf("e") ? "E" : "e", o2 = i3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2;
|
|
1317
|
+
return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !i3[3].startsWith(`.${r2}`) && i3[3][0] !== r2 ? n4.leadingZeros && !a2 ? (e5 = (i3[1] || "") + i3[3], Number(e5)) : t4 : Number(e5);
|
|
1328
1318
|
}
|
|
1329
|
-
return
|
|
1330
|
-
}
|
|
1319
|
+
return t4;
|
|
1320
|
+
}(t3, n3, e4);
|
|
1331
1321
|
{
|
|
1332
|
-
const
|
|
1333
|
-
if (
|
|
1334
|
-
const
|
|
1335
|
-
let a2 = (i2 =
|
|
1336
|
-
|
|
1337
|
-
if (!e4.leadingZeros && o2.length >
|
|
1338
|
-
if (e4.leadingZeros && o2 === t3) return 0;
|
|
1322
|
+
const s2 = D.exec(n3);
|
|
1323
|
+
if (s2) {
|
|
1324
|
+
const r2 = s2[1] || "", o2 = s2[2];
|
|
1325
|
+
let a2 = (i2 = s2[3]) && -1 !== i2.indexOf(".") ? ("." === (i2 = i2.replace(/0+$/, "")) ? i2 = "0" : "." === i2[0] ? i2 = "0" + i2 : "." === i2[i2.length - 1] && (i2 = i2.substring(0, i2.length - 1)), i2) : i2;
|
|
1326
|
+
const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length];
|
|
1327
|
+
if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3;
|
|
1339
1328
|
{
|
|
1340
|
-
const i3 = Number(n3),
|
|
1341
|
-
|
|
1329
|
+
const i3 = Number(n3), s3 = String(i3);
|
|
1330
|
+
if (0 === i3 || -0 === i3) return i3;
|
|
1331
|
+
if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? i3 : t3;
|
|
1332
|
+
if (-1 !== n3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? i3 : t3;
|
|
1333
|
+
let l3 = o2 ? a2 : n3;
|
|
1334
|
+
return o2 ? l3 === s3 || r2 + l3 === s3 ? i3 : t3 : l3 === s3 || l3 === r2 + s3 ? i3 : t3;
|
|
1342
1335
|
}
|
|
1343
1336
|
}
|
|
1344
1337
|
return t3;
|
|
@@ -1348,55 +1341,55 @@ var require_fxp = __commonJS({
|
|
|
1348
1341
|
}
|
|
1349
1342
|
return void 0 !== t2 ? t2 : "";
|
|
1350
1343
|
}
|
|
1351
|
-
__name(
|
|
1352
|
-
const
|
|
1353
|
-
function
|
|
1354
|
-
return
|
|
1344
|
+
__name(H, "H");
|
|
1345
|
+
const K = T.getMetaDataSymbol();
|
|
1346
|
+
function Q(t2, e2) {
|
|
1347
|
+
return tt(t2, e2);
|
|
1355
1348
|
}
|
|
1356
|
-
__name(
|
|
1357
|
-
function
|
|
1349
|
+
__name(Q, "Q");
|
|
1350
|
+
function tt(t2, e2, n2) {
|
|
1358
1351
|
let i2;
|
|
1359
|
-
const
|
|
1360
|
-
for (let
|
|
1361
|
-
const o2 = t2[
|
|
1352
|
+
const s2 = {};
|
|
1353
|
+
for (let r2 = 0; r2 < t2.length; r2++) {
|
|
1354
|
+
const o2 = t2[r2], a2 = et(o2);
|
|
1362
1355
|
let l2 = "";
|
|
1363
1356
|
if (l2 = void 0 === n2 ? a2 : n2 + "." + a2, a2 === e2.textNodeName) void 0 === i2 ? i2 = o2[a2] : i2 += "" + o2[a2];
|
|
1364
1357
|
else {
|
|
1365
1358
|
if (void 0 === a2) continue;
|
|
1366
1359
|
if (o2[a2]) {
|
|
1367
|
-
let t3 =
|
|
1368
|
-
const n3 =
|
|
1369
|
-
void 0 !== o2[
|
|
1360
|
+
let t3 = tt(o2[a2], e2, l2);
|
|
1361
|
+
const n3 = it(t3, e2);
|
|
1362
|
+
void 0 !== o2[K] && (t3[K] = o2[K]), o2[":@"] ? nt(t3, o2[":@"], l2, e2) : 1 !== Object.keys(t3).length || void 0 === t3[e2.textNodeName] || e2.alwaysCreateTextNode ? 0 === Object.keys(t3).length && (e2.alwaysCreateTextNode ? t3[e2.textNodeName] = "" : t3 = "") : t3 = t3[e2.textNodeName], void 0 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, n3) ? s2[a2] = [t3] : s2[a2] = t3;
|
|
1370
1363
|
}
|
|
1371
1364
|
}
|
|
1372
1365
|
}
|
|
1373
|
-
return "string" == typeof i2 ? i2.length > 0 && (
|
|
1366
|
+
return "string" == typeof i2 ? i2.length > 0 && (s2[e2.textNodeName] = i2) : void 0 !== i2 && (s2[e2.textNodeName] = i2), s2;
|
|
1374
1367
|
}
|
|
1375
|
-
__name(
|
|
1376
|
-
function
|
|
1368
|
+
__name(tt, "tt");
|
|
1369
|
+
function et(t2) {
|
|
1377
1370
|
const e2 = Object.keys(t2);
|
|
1378
1371
|
for (let t3 = 0; t3 < e2.length; t3++) {
|
|
1379
1372
|
const n2 = e2[t3];
|
|
1380
1373
|
if (":@" !== n2) return n2;
|
|
1381
1374
|
}
|
|
1382
1375
|
}
|
|
1383
|
-
__name(
|
|
1384
|
-
function
|
|
1376
|
+
__name(et, "et");
|
|
1377
|
+
function nt(t2, e2, n2, i2) {
|
|
1385
1378
|
if (e2) {
|
|
1386
|
-
const
|
|
1387
|
-
for (let o2 = 0; o2 <
|
|
1388
|
-
const
|
|
1389
|
-
i2.isArray(
|
|
1379
|
+
const s2 = Object.keys(e2), r2 = s2.length;
|
|
1380
|
+
for (let o2 = 0; o2 < r2; o2++) {
|
|
1381
|
+
const r3 = s2[o2];
|
|
1382
|
+
i2.isArray(r3, n2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3];
|
|
1390
1383
|
}
|
|
1391
1384
|
}
|
|
1392
1385
|
}
|
|
1393
|
-
__name(
|
|
1394
|
-
function
|
|
1386
|
+
__name(nt, "nt");
|
|
1387
|
+
function it(t2, e2) {
|
|
1395
1388
|
const { textNodeName: n2 } = e2, i2 = Object.keys(t2).length;
|
|
1396
1389
|
return 0 === i2 || !(1 !== i2 || !t2[n2] && "boolean" != typeof t2[n2] && 0 !== t2[n2]);
|
|
1397
1390
|
}
|
|
1398
|
-
__name(
|
|
1399
|
-
const
|
|
1391
|
+
__name(it, "it");
|
|
1392
|
+
const _st = class _st {
|
|
1400
1393
|
constructor(t2) {
|
|
1401
1394
|
this.externalEntities = {}, this.options = function(t3) {
|
|
1402
1395
|
return Object.assign({}, v, t3);
|
|
@@ -1413,10 +1406,10 @@ var require_fxp = __commonJS({
|
|
|
1413
1406
|
const n3 = a(t2, e2);
|
|
1414
1407
|
if (true !== n3) throw Error(`${n3.err.msg}:${n3.err.line}:${n3.err.col}`);
|
|
1415
1408
|
}
|
|
1416
|
-
const n2 = new
|
|
1409
|
+
const n2 = new k(this.options);
|
|
1417
1410
|
n2.addExternalEntities(this.externalEntities);
|
|
1418
1411
|
const i2 = n2.parseXml(t2);
|
|
1419
|
-
return this.options.preserveOrder || void 0 === i2 ? i2 :
|
|
1412
|
+
return this.options.preserveOrder || void 0 === i2 ? i2 : Q(i2, this.options);
|
|
1420
1413
|
}
|
|
1421
1414
|
addEntity(t2, e2) {
|
|
1422
1415
|
if (-1 !== e2.indexOf("&")) throw new Error("Entity value can't have '&'");
|
|
@@ -1428,168 +1421,168 @@ var require_fxp = __commonJS({
|
|
|
1428
1421
|
return T.getMetaDataSymbol();
|
|
1429
1422
|
}
|
|
1430
1423
|
};
|
|
1431
|
-
__name(
|
|
1432
|
-
let
|
|
1433
|
-
function
|
|
1424
|
+
__name(_st, "st");
|
|
1425
|
+
let st = _st;
|
|
1426
|
+
function rt(t2, e2) {
|
|
1434
1427
|
let n2 = "";
|
|
1435
|
-
return e2.format && e2.indentBy.length > 0 && (n2 = "\n"),
|
|
1428
|
+
return e2.format && e2.indentBy.length > 0 && (n2 = "\n"), ot(t2, e2, "", n2);
|
|
1436
1429
|
}
|
|
1437
|
-
__name(
|
|
1438
|
-
function
|
|
1439
|
-
let
|
|
1430
|
+
__name(rt, "rt");
|
|
1431
|
+
function ot(t2, e2, n2, i2) {
|
|
1432
|
+
let s2 = "", r2 = false;
|
|
1440
1433
|
for (let o2 = 0; o2 < t2.length; o2++) {
|
|
1441
|
-
const a2 = t2[o2], l2 =
|
|
1434
|
+
const a2 = t2[o2], l2 = at(a2);
|
|
1442
1435
|
if (void 0 === l2) continue;
|
|
1443
1436
|
let u2 = "";
|
|
1444
1437
|
if (u2 = 0 === n2.length ? l2 : `${n2}.${l2}`, l2 === e2.textNodeName) {
|
|
1445
1438
|
let t3 = a2[l2];
|
|
1446
|
-
|
|
1439
|
+
ut(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ht(t3, e2)), r2 && (s2 += i2), s2 += t3, r2 = false;
|
|
1447
1440
|
continue;
|
|
1448
1441
|
}
|
|
1449
1442
|
if (l2 === e2.cdataPropName) {
|
|
1450
|
-
|
|
1443
|
+
r2 && (s2 += i2), s2 += `<![CDATA[${a2[l2][0][e2.textNodeName]}]]>`, r2 = false;
|
|
1451
1444
|
continue;
|
|
1452
1445
|
}
|
|
1453
1446
|
if (l2 === e2.commentPropName) {
|
|
1454
|
-
|
|
1447
|
+
s2 += i2 + `<!--${a2[l2][0][e2.textNodeName]}-->`, r2 = true;
|
|
1455
1448
|
continue;
|
|
1456
1449
|
}
|
|
1457
1450
|
if ("?" === l2[0]) {
|
|
1458
|
-
const t3 =
|
|
1451
|
+
const t3 = lt(a2[":@"], e2), n3 = "?xml" === l2 ? "" : i2;
|
|
1459
1452
|
let o3 = a2[l2][0][e2.textNodeName];
|
|
1460
|
-
o3 = 0 !== o3.length ? " " + o3 : "",
|
|
1453
|
+
o3 = 0 !== o3.length ? " " + o3 : "", s2 += n3 + `<${l2}${o3}${t3}?>`, r2 = true;
|
|
1461
1454
|
continue;
|
|
1462
1455
|
}
|
|
1463
1456
|
let h2 = i2;
|
|
1464
1457
|
"" !== h2 && (h2 += e2.indentBy);
|
|
1465
|
-
const d2 = i2 + `<${l2}${
|
|
1466
|
-
-1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ?
|
|
1458
|
+
const d2 = i2 + `<${l2}${lt(a2[":@"], e2)}`, f2 = ot(a2[l2], e2, u2, h2);
|
|
1459
|
+
-1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : f2 && 0 !== f2.length || !e2.suppressEmptyNode ? f2 && f2.endsWith(">") ? s2 += d2 + `>${f2}${i2}</${l2}>` : (s2 += d2 + ">", f2 && "" !== i2 && (f2.includes("/>") || f2.includes("</")) ? s2 += i2 + e2.indentBy + f2 + i2 : s2 += f2, s2 += `</${l2}>`) : s2 += d2 + "/>", r2 = true;
|
|
1467
1460
|
}
|
|
1468
|
-
return
|
|
1461
|
+
return s2;
|
|
1469
1462
|
}
|
|
1470
|
-
__name(
|
|
1471
|
-
function
|
|
1463
|
+
__name(ot, "ot");
|
|
1464
|
+
function at(t2) {
|
|
1472
1465
|
const e2 = Object.keys(t2);
|
|
1473
1466
|
for (let n2 = 0; n2 < e2.length; n2++) {
|
|
1474
1467
|
const i2 = e2[n2];
|
|
1475
1468
|
if (t2.hasOwnProperty(i2) && ":@" !== i2) return i2;
|
|
1476
1469
|
}
|
|
1477
1470
|
}
|
|
1478
|
-
__name(
|
|
1479
|
-
function
|
|
1471
|
+
__name(at, "at");
|
|
1472
|
+
function lt(t2, e2) {
|
|
1480
1473
|
let n2 = "";
|
|
1481
1474
|
if (t2 && !e2.ignoreAttributes) for (let i2 in t2) {
|
|
1482
1475
|
if (!t2.hasOwnProperty(i2)) continue;
|
|
1483
|
-
let
|
|
1484
|
-
|
|
1476
|
+
let s2 = e2.attributeValueProcessor(i2, t2[i2]);
|
|
1477
|
+
s2 = ht(s2, e2), true === s2 && e2.suppressBooleanAttributes ? n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}` : n2 += ` ${i2.substr(e2.attributeNamePrefix.length)}="${s2}"`;
|
|
1485
1478
|
}
|
|
1486
1479
|
return n2;
|
|
1487
1480
|
}
|
|
1488
|
-
__name(
|
|
1489
|
-
function
|
|
1481
|
+
__name(lt, "lt");
|
|
1482
|
+
function ut(t2, e2) {
|
|
1490
1483
|
let n2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1);
|
|
1491
1484
|
for (let i2 in e2.stopNodes) if (e2.stopNodes[i2] === t2 || e2.stopNodes[i2] === "*." + n2) return true;
|
|
1492
1485
|
return false;
|
|
1493
1486
|
}
|
|
1494
|
-
__name(
|
|
1495
|
-
function
|
|
1487
|
+
__name(ut, "ut");
|
|
1488
|
+
function ht(t2, e2) {
|
|
1496
1489
|
if (t2 && t2.length > 0 && e2.processEntities) for (let n2 = 0; n2 < e2.entities.length; n2++) {
|
|
1497
1490
|
const i2 = e2.entities[n2];
|
|
1498
1491
|
t2 = t2.replace(i2.regex, i2.val);
|
|
1499
1492
|
}
|
|
1500
1493
|
return t2;
|
|
1501
1494
|
}
|
|
1502
|
-
__name(
|
|
1503
|
-
const
|
|
1495
|
+
__name(ht, "ht");
|
|
1496
|
+
const dt = { attributeNamePrefix: "@_", attributesGroupName: false, textNodeName: "#text", ignoreAttributes: true, cdataPropName: false, format: false, indentBy: " ", suppressEmptyNode: false, suppressUnpairedNode: true, suppressBooleanAttributes: true, tagValueProcessor: /* @__PURE__ */ __name(function(t2, e2) {
|
|
1504
1497
|
return e2;
|
|
1505
1498
|
}, "tagValueProcessor"), attributeValueProcessor: /* @__PURE__ */ __name(function(t2, e2) {
|
|
1506
1499
|
return e2;
|
|
1507
1500
|
}, "attributeValueProcessor"), preserveOrder: false, commentPropName: false, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: true, stopNodes: [], oneListGroup: false };
|
|
1508
|
-
function
|
|
1509
|
-
this.options = Object.assign({},
|
|
1501
|
+
function ft(t2) {
|
|
1502
|
+
this.options = Object.assign({}, dt, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
1510
1503
|
return false;
|
|
1511
|
-
} : (this.ignoreAttributesFn =
|
|
1504
|
+
} : (this.ignoreAttributesFn = _(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = gt), this.processTextOrObjNode = ct, this.options.format ? (this.indentate = pt, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
|
|
1512
1505
|
return "";
|
|
1513
1506
|
}, this.tagEndChar = ">", this.newLine = "");
|
|
1514
1507
|
}
|
|
1515
|
-
__name(
|
|
1516
|
-
function
|
|
1517
|
-
const
|
|
1518
|
-
return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2,
|
|
1508
|
+
__name(ft, "ft");
|
|
1509
|
+
function ct(t2, e2, n2, i2) {
|
|
1510
|
+
const s2 = this.j2x(t2, n2 + 1, i2.concat(e2));
|
|
1511
|
+
return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, n2) : this.buildObjectNode(s2.val, e2, s2.attrStr, n2);
|
|
1519
1512
|
}
|
|
1520
|
-
__name(
|
|
1521
|
-
function
|
|
1513
|
+
__name(ct, "ct");
|
|
1514
|
+
function pt(t2) {
|
|
1522
1515
|
return this.options.indentBy.repeat(t2);
|
|
1523
1516
|
}
|
|
1524
|
-
__name(
|
|
1525
|
-
function
|
|
1517
|
+
__name(pt, "pt");
|
|
1518
|
+
function gt(t2) {
|
|
1526
1519
|
return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen);
|
|
1527
1520
|
}
|
|
1528
|
-
__name(
|
|
1529
|
-
|
|
1530
|
-
return this.options.preserveOrder ?
|
|
1531
|
-
},
|
|
1532
|
-
let i2 = "",
|
|
1533
|
-
const
|
|
1534
|
-
for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (
|
|
1535
|
-
else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ?
|
|
1536
|
-
else if (t2[o2] instanceof Date)
|
|
1521
|
+
__name(gt, "gt");
|
|
1522
|
+
ft.prototype.build = function(t2) {
|
|
1523
|
+
return this.options.preserveOrder ? rt(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val);
|
|
1524
|
+
}, ft.prototype.j2x = function(t2, e2, n2) {
|
|
1525
|
+
let i2 = "", s2 = "";
|
|
1526
|
+
const r2 = n2.join(".");
|
|
1527
|
+
for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += "");
|
|
1528
|
+
else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar;
|
|
1529
|
+
else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2);
|
|
1537
1530
|
else if ("object" != typeof t2[o2]) {
|
|
1538
1531
|
const n3 = this.isAttribute(o2);
|
|
1539
|
-
if (n3 && !this.ignoreAttributesFn(n3,
|
|
1532
|
+
if (n3 && !this.ignoreAttributesFn(n3, r2)) i2 += this.buildAttrPairStr(n3, "" + t2[o2]);
|
|
1540
1533
|
else if (!n3) if (o2 === this.options.textNodeName) {
|
|
1541
1534
|
let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]);
|
|
1542
|
-
|
|
1543
|
-
} else
|
|
1535
|
+
s2 += this.replaceEntitiesValue(e3);
|
|
1536
|
+
} else s2 += this.buildTextValNode(t2[o2], o2, "", e2);
|
|
1544
1537
|
} else if (Array.isArray(t2[o2])) {
|
|
1545
1538
|
const i3 = t2[o2].length;
|
|
1546
|
-
let
|
|
1539
|
+
let r3 = "", a2 = "";
|
|
1547
1540
|
for (let l2 = 0; l2 < i3; l2++) {
|
|
1548
1541
|
const i4 = t2[o2][l2];
|
|
1549
1542
|
if (void 0 === i4) ;
|
|
1550
|
-
else if (null === i4) "?" === o2[0] ?
|
|
1543
|
+
else if (null === i4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar;
|
|
1551
1544
|
else if ("object" == typeof i4) if (this.options.oneListGroup) {
|
|
1552
1545
|
const t3 = this.j2x(i4, e2 + 1, n2.concat(o2));
|
|
1553
|
-
|
|
1554
|
-
} else
|
|
1546
|
+
r3 += t3.val, this.options.attributesGroupName && i4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr);
|
|
1547
|
+
} else r3 += this.processTextOrObjNode(i4, o2, e2, n2);
|
|
1555
1548
|
else if (this.options.oneListGroup) {
|
|
1556
1549
|
let t3 = this.options.tagValueProcessor(o2, i4);
|
|
1557
|
-
t3 = this.replaceEntitiesValue(t3),
|
|
1558
|
-
} else
|
|
1550
|
+
t3 = this.replaceEntitiesValue(t3), r3 += t3;
|
|
1551
|
+
} else r3 += this.buildTextValNode(i4, o2, "", e2);
|
|
1559
1552
|
}
|
|
1560
|
-
this.options.oneListGroup && (
|
|
1553
|
+
this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3;
|
|
1561
1554
|
} else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) {
|
|
1562
1555
|
const e3 = Object.keys(t2[o2]), n3 = e3.length;
|
|
1563
|
-
for (let
|
|
1564
|
-
} else
|
|
1565
|
-
return { attrStr: i2, val:
|
|
1566
|
-
},
|
|
1556
|
+
for (let s3 = 0; s3 < n3; s3++) i2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]);
|
|
1557
|
+
} else s2 += this.processTextOrObjNode(t2[o2], o2, e2, n2);
|
|
1558
|
+
return { attrStr: i2, val: s2 };
|
|
1559
|
+
}, ft.prototype.buildAttrPairStr = function(t2, e2) {
|
|
1567
1560
|
return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"';
|
|
1568
|
-
},
|
|
1561
|
+
}, ft.prototype.buildObjectNode = function(t2, e2, n2, i2) {
|
|
1569
1562
|
if ("" === t2) return "?" === e2[0] ? this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar;
|
|
1570
1563
|
{
|
|
1571
|
-
let
|
|
1572
|
-
return "?" === e2[0] && (
|
|
1564
|
+
let s2 = "</" + e2 + this.tagEndChar, r2 = "";
|
|
1565
|
+
return "?" === e2[0] && (r2 = "?", s2 = ""), !n2 && "" !== n2 || -1 !== t2.indexOf("<") ? false !== this.options.commentPropName && e2 === this.options.commentPropName && 0 === r2.length ? this.indentate(i2) + `<!--${t2}-->` + this.newLine : this.indentate(i2) + "<" + e2 + n2 + r2 + this.tagEndChar + t2 + this.indentate(i2) + s2 : this.indentate(i2) + "<" + e2 + n2 + r2 + ">" + t2 + s2;
|
|
1573
1566
|
}
|
|
1574
|
-
},
|
|
1567
|
+
}, ft.prototype.closeTag = function(t2) {
|
|
1575
1568
|
let e2 = "";
|
|
1576
1569
|
return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `></${t2}`, e2;
|
|
1577
|
-
},
|
|
1570
|
+
}, ft.prototype.buildTextValNode = function(t2, e2, n2, i2) {
|
|
1578
1571
|
if (false !== this.options.cdataPropName && e2 === this.options.cdataPropName) return this.indentate(i2) + `<![CDATA[${t2}]]>` + this.newLine;
|
|
1579
1572
|
if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(i2) + `<!--${t2}-->` + this.newLine;
|
|
1580
1573
|
if ("?" === e2[0]) return this.indentate(i2) + "<" + e2 + n2 + "?" + this.tagEndChar;
|
|
1581
1574
|
{
|
|
1582
|
-
let
|
|
1583
|
-
return
|
|
1575
|
+
let s2 = this.options.tagValueProcessor(e2, t2);
|
|
1576
|
+
return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(i2) + "<" + e2 + n2 + this.closeTag(e2) + this.tagEndChar : this.indentate(i2) + "<" + e2 + n2 + ">" + s2 + "</" + e2 + this.tagEndChar;
|
|
1584
1577
|
}
|
|
1585
|
-
},
|
|
1578
|
+
}, ft.prototype.replaceEntitiesValue = function(t2) {
|
|
1586
1579
|
if (t2 && t2.length > 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) {
|
|
1587
1580
|
const n2 = this.options.entities[e2];
|
|
1588
1581
|
t2 = t2.replace(n2.regex, n2.val);
|
|
1589
1582
|
}
|
|
1590
1583
|
return t2;
|
|
1591
1584
|
};
|
|
1592
|
-
const
|
|
1585
|
+
const mt = { validate: a };
|
|
1593
1586
|
module.exports = e;
|
|
1594
1587
|
})();
|
|
1595
1588
|
}
|