@dan-uni/dan-any-plugin-detaolu 1.3.9 → 1.4.8
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/index.js +218 -166
- package/dist/index.umd.min.js +1868 -438
- package/dist/pakku.js/similarity_stub.d.ts +1 -1
- package/dist/static/wasm/{54a7637a81.module.wasm → 21072e5de5.module.wasm} +0 -0
- package/package.json +1 -1
- package/src/index.ts +5 -5
- package/src/pakku.js/index.ts +88 -62
- package/src/pakku.js/similarity-gen.js +20 -2
- package/src/pakku.js/similarity-gen.wasm +0 -0
- package/src/pakku.js/similarity_stub.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.umd.min.js
CHANGED
|
@@ -1510,10 +1510,7 @@
|
|
|
1510
1510
|
},
|
|
1511
1511
|
"../../node_modules/.pnpm/base16384@1.0.0/node_modules/base16384/lib/index.js" (__unused_rspack_module, exports1) {
|
|
1512
1512
|
"use strict";
|
|
1513
|
-
|
|
1514
|
-
value: true
|
|
1515
|
-
});
|
|
1516
|
-
exports1.decode = exports1.toUint16Array = exports1.encode = exports1.toUint8Array = void 0;
|
|
1513
|
+
exports1.D4 = exports1.lF = void 0;
|
|
1517
1514
|
function align(input, output, sWidth, tWidth, sOffset, tOffset) {
|
|
1518
1515
|
let offset = 0;
|
|
1519
1516
|
let rest = 0;
|
|
@@ -1536,7 +1533,6 @@
|
|
|
1536
1533
|
function toUint8Array(source) {
|
|
1537
1534
|
return new TextEncoder().encode(source);
|
|
1538
1535
|
}
|
|
1539
|
-
exports1.toUint8Array = toUint8Array;
|
|
1540
1536
|
function encode(input) {
|
|
1541
1537
|
if ('string' == typeof input) input = toUint8Array(input);
|
|
1542
1538
|
const output = new Uint16Array(Math.ceil(4 * input.length / 7) + 1);
|
|
@@ -1544,13 +1540,12 @@
|
|
|
1544
1540
|
output[output.length - 1] = input.length % 7 + 0x3d00;
|
|
1545
1541
|
return output;
|
|
1546
1542
|
}
|
|
1547
|
-
exports1.
|
|
1543
|
+
exports1.lF = encode;
|
|
1548
1544
|
function toUint16Array(source) {
|
|
1549
1545
|
const input = new Uint16Array(source.length);
|
|
1550
1546
|
for(let i = 0; i < source.length; i++)input[i] = source.charCodeAt(i);
|
|
1551
1547
|
return input;
|
|
1552
1548
|
}
|
|
1553
|
-
exports1.toUint16Array = toUint16Array;
|
|
1554
1549
|
function decode(input) {
|
|
1555
1550
|
if ('string' == typeof input) input = toUint16Array(input);
|
|
1556
1551
|
const length = input.length - 1;
|
|
@@ -1559,7 +1554,7 @@
|
|
|
1559
1554
|
align(input, output, 14, 8, 0x4e00, 0);
|
|
1560
1555
|
return output;
|
|
1561
1556
|
}
|
|
1562
|
-
exports1.
|
|
1557
|
+
exports1.D4 = decode;
|
|
1563
1558
|
},
|
|
1564
1559
|
"../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js" (__unused_rspack_module, exports1) {
|
|
1565
1560
|
"use strict";
|
|
@@ -4521,14 +4516,14 @@
|
|
|
4521
4516
|
else forEachObject(list, iterator, receiver);
|
|
4522
4517
|
};
|
|
4523
4518
|
},
|
|
4524
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4519
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/copy-sync.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4525
4520
|
"use strict";
|
|
4526
4521
|
var process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
4527
4522
|
const fs = __webpack_require__("../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js");
|
|
4528
4523
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
4529
|
-
const mkdirsSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4530
|
-
const utimesMillisSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4531
|
-
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4524
|
+
const mkdirsSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js").mkdirsSync;
|
|
4525
|
+
const utimesMillisSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/utimes.js").utimesMillisSync;
|
|
4526
|
+
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js");
|
|
4532
4527
|
function copySync(src, dest, opts) {
|
|
4533
4528
|
if ('function' == typeof opts) opts = {
|
|
4534
4529
|
filter: opts
|
|
@@ -4638,16 +4633,16 @@
|
|
|
4638
4633
|
}
|
|
4639
4634
|
module1.exports = copySync;
|
|
4640
4635
|
},
|
|
4641
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4636
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/copy.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4642
4637
|
"use strict";
|
|
4643
4638
|
var process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
4644
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4639
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
4645
4640
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
4646
|
-
const { mkdirs } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4647
|
-
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4648
|
-
const { utimesMillis } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4649
|
-
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4650
|
-
const { asyncIteratorConcurrentProcess } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4641
|
+
const { mkdirs } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js");
|
|
4642
|
+
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js");
|
|
4643
|
+
const { utimesMillis } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/utimes.js");
|
|
4644
|
+
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js");
|
|
4645
|
+
const { asyncIteratorConcurrentProcess } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/async.js");
|
|
4651
4646
|
async function copy(src, dest, opts = {}) {
|
|
4652
4647
|
if ('function' == typeof opts) opts = {
|
|
4653
4648
|
filter: opts
|
|
@@ -4735,21 +4730,21 @@
|
|
|
4735
4730
|
}
|
|
4736
4731
|
module1.exports = copy;
|
|
4737
4732
|
},
|
|
4738
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4733
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4739
4734
|
"use strict";
|
|
4740
4735
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
4741
4736
|
module1.exports = {
|
|
4742
|
-
copy: u(__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4743
|
-
copySync: __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4737
|
+
copy: u(__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/copy.js")),
|
|
4738
|
+
copySync: __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/copy-sync.js")
|
|
4744
4739
|
};
|
|
4745
4740
|
},
|
|
4746
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4741
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/empty/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4747
4742
|
"use strict";
|
|
4748
4743
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
4749
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4744
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
4750
4745
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
4751
|
-
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4752
|
-
const remove = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4746
|
+
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js");
|
|
4747
|
+
const remove = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/remove/index.js");
|
|
4753
4748
|
const emptyDir = u(async function(dir) {
|
|
4754
4749
|
let items;
|
|
4755
4750
|
try {
|
|
@@ -4778,12 +4773,12 @@
|
|
|
4778
4773
|
emptydir: emptyDir
|
|
4779
4774
|
};
|
|
4780
4775
|
},
|
|
4781
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4776
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/file.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4782
4777
|
"use strict";
|
|
4783
4778
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
4784
4779
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
4785
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4786
|
-
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4780
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
4781
|
+
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js");
|
|
4787
4782
|
async function createFile(file) {
|
|
4788
4783
|
let stats;
|
|
4789
4784
|
try {
|
|
@@ -4825,11 +4820,11 @@
|
|
|
4825
4820
|
createFileSync
|
|
4826
4821
|
};
|
|
4827
4822
|
},
|
|
4828
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4823
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4829
4824
|
"use strict";
|
|
4830
|
-
const { createFile, createFileSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4831
|
-
const { createLink, createLinkSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4832
|
-
const { createSymlink, createSymlinkSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4825
|
+
const { createFile, createFileSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/file.js");
|
|
4826
|
+
const { createLink, createLinkSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/link.js");
|
|
4827
|
+
const { createSymlink, createSymlinkSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink.js");
|
|
4833
4828
|
module1.exports = {
|
|
4834
4829
|
createFile,
|
|
4835
4830
|
createFileSync,
|
|
@@ -4845,22 +4840,26 @@
|
|
|
4845
4840
|
ensureSymlinkSync: createSymlinkSync
|
|
4846
4841
|
};
|
|
4847
4842
|
},
|
|
4848
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4843
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/link.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4849
4844
|
"use strict";
|
|
4850
4845
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
4851
4846
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
4852
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4853
|
-
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4854
|
-
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4855
|
-
const { areIdentical } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4847
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
4848
|
+
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js");
|
|
4849
|
+
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js");
|
|
4850
|
+
const { areIdentical } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js");
|
|
4856
4851
|
async function createLink(srcpath, dstpath) {
|
|
4857
4852
|
let dstStat;
|
|
4858
4853
|
try {
|
|
4859
|
-
dstStat = await fs.lstat(dstpath
|
|
4854
|
+
dstStat = await fs.lstat(dstpath, {
|
|
4855
|
+
bigint: true
|
|
4856
|
+
});
|
|
4860
4857
|
} catch {}
|
|
4861
4858
|
let srcStat;
|
|
4862
4859
|
try {
|
|
4863
|
-
srcStat = await fs.lstat(srcpath
|
|
4860
|
+
srcStat = await fs.lstat(srcpath, {
|
|
4861
|
+
bigint: true
|
|
4862
|
+
});
|
|
4864
4863
|
} catch (err) {
|
|
4865
4864
|
err.message = err.message.replace('lstat', 'ensureLink');
|
|
4866
4865
|
throw err;
|
|
@@ -4874,10 +4873,14 @@
|
|
|
4874
4873
|
function createLinkSync(srcpath, dstpath) {
|
|
4875
4874
|
let dstStat;
|
|
4876
4875
|
try {
|
|
4877
|
-
dstStat = fs.lstatSync(dstpath
|
|
4876
|
+
dstStat = fs.lstatSync(dstpath, {
|
|
4877
|
+
bigint: true
|
|
4878
|
+
});
|
|
4878
4879
|
} catch {}
|
|
4879
4880
|
try {
|
|
4880
|
-
const srcStat = fs.lstatSync(srcpath
|
|
4881
|
+
const srcStat = fs.lstatSync(srcpath, {
|
|
4882
|
+
bigint: true
|
|
4883
|
+
});
|
|
4881
4884
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
4882
4885
|
} catch (err) {
|
|
4883
4886
|
err.message = err.message.replace('lstat', 'ensureLink');
|
|
@@ -4894,11 +4897,11 @@
|
|
|
4894
4897
|
createLinkSync
|
|
4895
4898
|
};
|
|
4896
4899
|
},
|
|
4897
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4900
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink-paths.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4898
4901
|
"use strict";
|
|
4899
4902
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
4900
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4901
|
-
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4903
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
4904
|
+
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js");
|
|
4902
4905
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
4903
4906
|
async function symlinkPaths(srcpath, dstpath) {
|
|
4904
4907
|
if (path.isAbsolute(srcpath)) {
|
|
@@ -4959,9 +4962,9 @@
|
|
|
4959
4962
|
symlinkPathsSync
|
|
4960
4963
|
};
|
|
4961
4964
|
},
|
|
4962
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4965
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink-type.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4963
4966
|
"use strict";
|
|
4964
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4967
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
4965
4968
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
4966
4969
|
async function symlinkType(srcpath, type) {
|
|
4967
4970
|
if (type) return type;
|
|
@@ -4988,16 +4991,16 @@
|
|
|
4988
4991
|
symlinkTypeSync
|
|
4989
4992
|
};
|
|
4990
4993
|
},
|
|
4991
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
4994
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
4992
4995
|
"use strict";
|
|
4993
4996
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
4994
4997
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
4995
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4996
|
-
const { mkdirs, mkdirsSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4997
|
-
const { symlinkPaths, symlinkPathsSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4998
|
-
const { symlinkType, symlinkTypeSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4999
|
-
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5000
|
-
const { areIdentical } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
4998
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
4999
|
+
const { mkdirs, mkdirsSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js");
|
|
5000
|
+
const { symlinkPaths, symlinkPathsSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink-paths.js");
|
|
5001
|
+
const { symlinkType, symlinkTypeSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/symlink-type.js");
|
|
5002
|
+
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js");
|
|
5003
|
+
const { areIdentical } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js");
|
|
5001
5004
|
async function createSymlink(srcpath, dstpath, type) {
|
|
5002
5005
|
let stats;
|
|
5003
5006
|
try {
|
|
@@ -5005,17 +5008,25 @@
|
|
|
5005
5008
|
} catch {}
|
|
5006
5009
|
if (stats && stats.isSymbolicLink()) {
|
|
5007
5010
|
let srcStat;
|
|
5008
|
-
if (path.isAbsolute(srcpath)) srcStat = await fs.stat(srcpath
|
|
5011
|
+
if (path.isAbsolute(srcpath)) srcStat = await fs.stat(srcpath, {
|
|
5012
|
+
bigint: true
|
|
5013
|
+
});
|
|
5009
5014
|
else {
|
|
5010
5015
|
const dstdir = path.dirname(dstpath);
|
|
5011
5016
|
const relativeToDst = path.join(dstdir, srcpath);
|
|
5012
5017
|
try {
|
|
5013
|
-
srcStat = await fs.stat(relativeToDst
|
|
5018
|
+
srcStat = await fs.stat(relativeToDst, {
|
|
5019
|
+
bigint: true
|
|
5020
|
+
});
|
|
5014
5021
|
} catch {
|
|
5015
|
-
srcStat = await fs.stat(srcpath
|
|
5022
|
+
srcStat = await fs.stat(srcpath, {
|
|
5023
|
+
bigint: true
|
|
5024
|
+
});
|
|
5016
5025
|
}
|
|
5017
5026
|
}
|
|
5018
|
-
const dstStat = await fs.stat(dstpath
|
|
5027
|
+
const dstStat = await fs.stat(dstpath, {
|
|
5028
|
+
bigint: true
|
|
5029
|
+
});
|
|
5019
5030
|
if (areIdentical(srcStat, dstStat)) return;
|
|
5020
5031
|
}
|
|
5021
5032
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
@@ -5032,17 +5043,25 @@
|
|
|
5032
5043
|
} catch {}
|
|
5033
5044
|
if (stats && stats.isSymbolicLink()) {
|
|
5034
5045
|
let srcStat;
|
|
5035
|
-
if (path.isAbsolute(srcpath)) srcStat = fs.statSync(srcpath
|
|
5046
|
+
if (path.isAbsolute(srcpath)) srcStat = fs.statSync(srcpath, {
|
|
5047
|
+
bigint: true
|
|
5048
|
+
});
|
|
5036
5049
|
else {
|
|
5037
5050
|
const dstdir = path.dirname(dstpath);
|
|
5038
5051
|
const relativeToDst = path.join(dstdir, srcpath);
|
|
5039
5052
|
try {
|
|
5040
|
-
srcStat = fs.statSync(relativeToDst
|
|
5053
|
+
srcStat = fs.statSync(relativeToDst, {
|
|
5054
|
+
bigint: true
|
|
5055
|
+
});
|
|
5041
5056
|
} catch {
|
|
5042
|
-
srcStat = fs.statSync(srcpath
|
|
5057
|
+
srcStat = fs.statSync(srcpath, {
|
|
5058
|
+
bigint: true
|
|
5059
|
+
});
|
|
5043
5060
|
}
|
|
5044
5061
|
}
|
|
5045
|
-
const dstStat = fs.statSync(dstpath
|
|
5062
|
+
const dstStat = fs.statSync(dstpath, {
|
|
5063
|
+
bigint: true
|
|
5064
|
+
});
|
|
5046
5065
|
if (areIdentical(srcStat, dstStat)) return;
|
|
5047
5066
|
}
|
|
5048
5067
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
@@ -5059,7 +5078,7 @@
|
|
|
5059
5078
|
createSymlinkSync
|
|
5060
5079
|
};
|
|
5061
5080
|
},
|
|
5062
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5081
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js" (__unused_rspack_module, exports1, __webpack_require__) {
|
|
5063
5082
|
"use strict";
|
|
5064
5083
|
var process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
5065
5084
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromCallback;
|
|
@@ -5163,27 +5182,27 @@
|
|
|
5163
5182
|
if ('function' == typeof fs.realpath.native) exports1.realpath.native = u(fs.realpath.native);
|
|
5164
5183
|
else process.emitWarning('fs.realpath.native is not a function. Is fs being monkey-patched?', 'Warning', 'fs-extra-WARN0003');
|
|
5165
5184
|
},
|
|
5166
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5185
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5167
5186
|
"use strict";
|
|
5168
5187
|
module1.exports = {
|
|
5169
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5170
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5171
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5172
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5173
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5174
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5175
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5176
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5177
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5178
|
-
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5188
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js"),
|
|
5189
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/index.js"),
|
|
5190
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/empty/index.js"),
|
|
5191
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/ensure/index.js"),
|
|
5192
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/index.js"),
|
|
5193
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js"),
|
|
5194
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/index.js"),
|
|
5195
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/output-file/index.js"),
|
|
5196
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js"),
|
|
5197
|
+
...__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/remove/index.js")
|
|
5179
5198
|
};
|
|
5180
5199
|
},
|
|
5181
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5200
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5182
5201
|
"use strict";
|
|
5183
5202
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
5184
|
-
const jsonFile = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5185
|
-
jsonFile.outputJson = u(__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5186
|
-
jsonFile.outputJsonSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5203
|
+
const jsonFile = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/jsonfile.js");
|
|
5204
|
+
jsonFile.outputJson = u(__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/output-json.js"));
|
|
5205
|
+
jsonFile.outputJsonSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/output-json-sync.js");
|
|
5187
5206
|
jsonFile.outputJSON = jsonFile.outputJson;
|
|
5188
5207
|
jsonFile.outputJSONSync = jsonFile.outputJsonSync;
|
|
5189
5208
|
jsonFile.writeJSON = jsonFile.writeJson;
|
|
@@ -5192,7 +5211,7 @@
|
|
|
5192
5211
|
jsonFile.readJSONSync = jsonFile.readJsonSync;
|
|
5193
5212
|
module1.exports = jsonFile;
|
|
5194
5213
|
},
|
|
5195
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5214
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/jsonfile.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5196
5215
|
"use strict";
|
|
5197
5216
|
const jsonFile = __webpack_require__("../../node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/index.js");
|
|
5198
5217
|
module1.exports = {
|
|
@@ -5202,30 +5221,30 @@
|
|
|
5202
5221
|
writeJsonSync: jsonFile.writeFileSync
|
|
5203
5222
|
};
|
|
5204
5223
|
},
|
|
5205
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5224
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/output-json-sync.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5206
5225
|
"use strict";
|
|
5207
5226
|
const { stringify } = __webpack_require__("../../node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/utils.js");
|
|
5208
|
-
const { outputFileSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5227
|
+
const { outputFileSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/output-file/index.js");
|
|
5209
5228
|
function outputJsonSync(file, data, options) {
|
|
5210
5229
|
const str = stringify(data, options);
|
|
5211
5230
|
outputFileSync(file, str, options);
|
|
5212
5231
|
}
|
|
5213
5232
|
module1.exports = outputJsonSync;
|
|
5214
5233
|
},
|
|
5215
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5234
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/json/output-json.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5216
5235
|
"use strict";
|
|
5217
5236
|
const { stringify } = __webpack_require__("../../node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/utils.js");
|
|
5218
|
-
const { outputFile } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5237
|
+
const { outputFile } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/output-file/index.js");
|
|
5219
5238
|
async function outputJson(file, data, options = {}) {
|
|
5220
5239
|
const str = stringify(data, options);
|
|
5221
5240
|
await outputFile(file, str, options);
|
|
5222
5241
|
}
|
|
5223
5242
|
module1.exports = outputJson;
|
|
5224
5243
|
},
|
|
5225
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5244
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5226
5245
|
"use strict";
|
|
5227
5246
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
5228
|
-
const { makeDir: _makeDir, makeDirSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5247
|
+
const { makeDir: _makeDir, makeDirSync } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/make-dir.js");
|
|
5229
5248
|
const makeDir = u(_makeDir);
|
|
5230
5249
|
module1.exports = {
|
|
5231
5250
|
mkdirs: makeDir,
|
|
@@ -5236,10 +5255,10 @@
|
|
|
5236
5255
|
ensureDirSync: makeDirSync
|
|
5237
5256
|
};
|
|
5238
5257
|
},
|
|
5239
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5258
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/make-dir.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5240
5259
|
"use strict";
|
|
5241
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5242
|
-
const { checkPath } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5260
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
5261
|
+
const { checkPath } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/utils.js");
|
|
5243
5262
|
const getMode = (options)=>{
|
|
5244
5263
|
const defaults = {
|
|
5245
5264
|
mode: 0o777
|
|
@@ -5265,7 +5284,7 @@
|
|
|
5265
5284
|
});
|
|
5266
5285
|
};
|
|
5267
5286
|
},
|
|
5268
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5287
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/utils.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5269
5288
|
"use strict";
|
|
5270
5289
|
var process = __webpack_require__("../../node_modules/.pnpm/process@0.11.10/node_modules/process/browser.js");
|
|
5271
5290
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
@@ -5280,22 +5299,22 @@
|
|
|
5280
5299
|
}
|
|
5281
5300
|
};
|
|
5282
5301
|
},
|
|
5283
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5302
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5284
5303
|
"use strict";
|
|
5285
5304
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
5286
5305
|
module1.exports = {
|
|
5287
|
-
move: u(__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5288
|
-
moveSync: __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5306
|
+
move: u(__webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/move.js")),
|
|
5307
|
+
moveSync: __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/move-sync.js")
|
|
5289
5308
|
};
|
|
5290
5309
|
},
|
|
5291
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5310
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/move-sync.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5292
5311
|
"use strict";
|
|
5293
5312
|
const fs = __webpack_require__("../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js");
|
|
5294
5313
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
5295
|
-
const copySync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5296
|
-
const removeSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5297
|
-
const mkdirpSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5298
|
-
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5314
|
+
const copySync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/index.js").copySync;
|
|
5315
|
+
const removeSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/remove/index.js").removeSync;
|
|
5316
|
+
const mkdirpSync = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js").mkdirpSync;
|
|
5317
|
+
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js");
|
|
5299
5318
|
function moveSync(src, dest, opts) {
|
|
5300
5319
|
opts = opts || {};
|
|
5301
5320
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
@@ -5337,15 +5356,15 @@
|
|
|
5337
5356
|
}
|
|
5338
5357
|
module1.exports = moveSync;
|
|
5339
5358
|
},
|
|
5340
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5359
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/move/move.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5341
5360
|
"use strict";
|
|
5342
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5361
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
5343
5362
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
5344
|
-
const { copy } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5345
|
-
const { remove } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5346
|
-
const { mkdirp } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5347
|
-
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5348
|
-
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5363
|
+
const { copy } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/copy/index.js");
|
|
5364
|
+
const { remove } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/remove/index.js");
|
|
5365
|
+
const { mkdirp } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js");
|
|
5366
|
+
const { pathExists } = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js");
|
|
5367
|
+
const stat = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js");
|
|
5349
5368
|
async function move(src, dest, opts = {}) {
|
|
5350
5369
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
5351
5370
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, 'move', opts);
|
|
@@ -5378,13 +5397,13 @@
|
|
|
5378
5397
|
}
|
|
5379
5398
|
module1.exports = move;
|
|
5380
5399
|
},
|
|
5381
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5400
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/output-file/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5382
5401
|
"use strict";
|
|
5383
5402
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
5384
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5403
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
5385
5404
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
5386
|
-
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5387
|
-
const pathExists = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5405
|
+
const mkdir = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/mkdirs/index.js");
|
|
5406
|
+
const pathExists = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js").pathExists;
|
|
5388
5407
|
async function outputFile(file, data, encoding = 'utf-8') {
|
|
5389
5408
|
const dir = path.dirname(file);
|
|
5390
5409
|
if (!await pathExists(dir)) await mkdir.mkdirs(dir);
|
|
@@ -5400,10 +5419,10 @@
|
|
|
5400
5419
|
outputFileSync
|
|
5401
5420
|
};
|
|
5402
5421
|
},
|
|
5403
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5422
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/path-exists/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5404
5423
|
"use strict";
|
|
5405
5424
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
5406
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5425
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
5407
5426
|
function pathExists(path) {
|
|
5408
5427
|
return fs.access(path).then(()=>true).catch(()=>false);
|
|
5409
5428
|
}
|
|
@@ -5412,7 +5431,7 @@
|
|
|
5412
5431
|
pathExistsSync: fs.existsSync
|
|
5413
5432
|
};
|
|
5414
5433
|
},
|
|
5415
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5434
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/remove/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5416
5435
|
"use strict";
|
|
5417
5436
|
const fs = __webpack_require__("../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js");
|
|
5418
5437
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromCallback;
|
|
@@ -5433,7 +5452,7 @@
|
|
|
5433
5452
|
removeSync
|
|
5434
5453
|
};
|
|
5435
5454
|
},
|
|
5436
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5455
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/async.js" (module1) {
|
|
5437
5456
|
"use strict";
|
|
5438
5457
|
async function asyncIteratorConcurrentProcess(iterator, fn) {
|
|
5439
5458
|
const promises = [];
|
|
@@ -5446,9 +5465,9 @@
|
|
|
5446
5465
|
asyncIteratorConcurrentProcess
|
|
5447
5466
|
};
|
|
5448
5467
|
},
|
|
5449
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5468
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/stat.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5450
5469
|
"use strict";
|
|
5451
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5470
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
5452
5471
|
const path = __webpack_require__("../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js");
|
|
5453
5472
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
5454
5473
|
function getStats(src, dest, opts) {
|
|
@@ -5586,28 +5605,41 @@
|
|
|
5586
5605
|
areIdentical
|
|
5587
5606
|
};
|
|
5588
5607
|
},
|
|
5589
|
-
"../../node_modules/.pnpm/fs-extra@11.3.
|
|
5608
|
+
"../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/util/utimes.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
5590
5609
|
"use strict";
|
|
5591
|
-
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
5610
|
+
const fs = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/fs/index.js");
|
|
5592
5611
|
const u = __webpack_require__("../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js").fromPromise;
|
|
5593
5612
|
async function utimesMillis(path, atime, mtime) {
|
|
5594
5613
|
const fd = await fs.open(path, 'r+');
|
|
5595
|
-
let
|
|
5614
|
+
let error = null;
|
|
5596
5615
|
try {
|
|
5597
5616
|
await fs.futimes(fd, atime, mtime);
|
|
5617
|
+
} catch (futimesErr) {
|
|
5618
|
+
error = futimesErr;
|
|
5598
5619
|
} finally{
|
|
5599
5620
|
try {
|
|
5600
5621
|
await fs.close(fd);
|
|
5601
|
-
} catch (
|
|
5602
|
-
|
|
5622
|
+
} catch (closeErr) {
|
|
5623
|
+
if (!error) error = closeErr;
|
|
5603
5624
|
}
|
|
5604
5625
|
}
|
|
5605
|
-
if (
|
|
5626
|
+
if (error) throw error;
|
|
5606
5627
|
}
|
|
5607
5628
|
function utimesMillisSync(path, atime, mtime) {
|
|
5608
5629
|
const fd = fs.openSync(path, 'r+');
|
|
5609
|
-
|
|
5610
|
-
|
|
5630
|
+
let error = null;
|
|
5631
|
+
try {
|
|
5632
|
+
fs.futimesSync(fd, atime, mtime);
|
|
5633
|
+
} catch (futimesErr) {
|
|
5634
|
+
error = futimesErr;
|
|
5635
|
+
} finally{
|
|
5636
|
+
try {
|
|
5637
|
+
fs.closeSync(fd);
|
|
5638
|
+
} catch (closeErr) {
|
|
5639
|
+
if (!error) error = closeErr;
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
if (error) throw error;
|
|
5611
5643
|
}
|
|
5612
5644
|
module1.exports = {
|
|
5613
5645
|
utimesMillis: u(utimesMillis),
|
|
@@ -12008,7 +12040,7 @@
|
|
|
12008
12040
|
},
|
|
12009
12041
|
"./src/pakku.js/similarity-gen.wasm" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
12010
12042
|
"use strict";
|
|
12011
|
-
module1.exports = __webpack_require__.p + "static/wasm/
|
|
12043
|
+
module1.exports = __webpack_require__.p + "static/wasm/21072e5de5.module.wasm";
|
|
12012
12044
|
},
|
|
12013
12045
|
"?efad" () {},
|
|
12014
12046
|
"?956c" () {},
|
|
@@ -13813,6 +13845,7 @@ and limitations under the License.
|
|
|
13813
13845
|
unpairedTags: [],
|
|
13814
13846
|
processEntities: true,
|
|
13815
13847
|
htmlEntities: false,
|
|
13848
|
+
entityDecoder: null,
|
|
13816
13849
|
ignoreDeclaration: false,
|
|
13817
13850
|
ignorePiTags: false,
|
|
13818
13851
|
transformTagName: false,
|
|
@@ -13832,16 +13865,17 @@ and limitations under the License.
|
|
|
13832
13865
|
if (DANGEROUS_PROPERTY_NAMES.some((dangerous)=>normalized === dangerous.toLowerCase())) throw new Error(`[SECURITY] Invalid ${optionName}: "${propertyName}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
13833
13866
|
if (criticalProperties.some((dangerous)=>normalized === dangerous.toLowerCase())) throw new Error(`[SECURITY] Invalid ${optionName}: "${propertyName}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
13834
13867
|
}
|
|
13835
|
-
function normalizeProcessEntities(value) {
|
|
13868
|
+
function normalizeProcessEntities(value, htmlEntities) {
|
|
13836
13869
|
if ('boolean' == typeof value) return {
|
|
13837
13870
|
enabled: value,
|
|
13838
13871
|
maxEntitySize: 10000,
|
|
13839
|
-
maxExpansionDepth:
|
|
13840
|
-
maxTotalExpansions:
|
|
13872
|
+
maxExpansionDepth: 10000,
|
|
13873
|
+
maxTotalExpansions: 1 / 0,
|
|
13841
13874
|
maxExpandedLength: 100000,
|
|
13842
|
-
maxEntityCount:
|
|
13875
|
+
maxEntityCount: 1000,
|
|
13843
13876
|
allowedTags: null,
|
|
13844
|
-
tagFilter: null
|
|
13877
|
+
tagFilter: null,
|
|
13878
|
+
appliesTo: "all"
|
|
13845
13879
|
};
|
|
13846
13880
|
if ('object' == typeof value && null !== value) return {
|
|
13847
13881
|
enabled: false !== value.enabled,
|
|
@@ -13851,7 +13885,8 @@ and limitations under the License.
|
|
|
13851
13885
|
maxExpandedLength: Math.max(1, value.maxExpandedLength ?? 100000),
|
|
13852
13886
|
maxEntityCount: Math.max(1, value.maxEntityCount ?? 1000),
|
|
13853
13887
|
allowedTags: value.allowedTags ?? null,
|
|
13854
|
-
tagFilter: value.tagFilter ?? null
|
|
13888
|
+
tagFilter: value.tagFilter ?? null,
|
|
13889
|
+
appliesTo: value.appliesTo ?? "all"
|
|
13855
13890
|
};
|
|
13856
13891
|
return normalizeProcessEntities(true);
|
|
13857
13892
|
}
|
|
@@ -13881,7 +13916,7 @@ and limitations under the License.
|
|
|
13881
13916
|
];
|
|
13882
13917
|
for (const { value, name } of propertyNameOptions)if (value) validatePropertyName(value, name);
|
|
13883
13918
|
if (null === built.onDangerousProperty) built.onDangerousProperty = defaultOnDangerousProperty;
|
|
13884
|
-
built.processEntities = normalizeProcessEntities(built.processEntities);
|
|
13919
|
+
built.processEntities = normalizeProcessEntities(built.processEntities, built.htmlEntities);
|
|
13885
13920
|
built.unpairedTagsSet = new Set(built.unpairedTags);
|
|
13886
13921
|
if (built.stopNodes && Array.isArray(built.stopNodes)) built.stopNodes = built.stopNodes.map((node)=>{
|
|
13887
13922
|
if ('string' == typeof node && node.startsWith('*.')) return '..' + node.substring(2);
|
|
@@ -13949,11 +13984,7 @@ and limitations under the License.
|
|
|
13949
13984
|
[entityName, val, i] = this.readEntityExp(xmlData, i + 1, this.suppressValidationErr);
|
|
13950
13985
|
if (-1 === val.indexOf("&")) {
|
|
13951
13986
|
if (false !== this.options.enabled && null != this.options.maxEntityCount && entityCount >= this.options.maxEntityCount) throw new Error(`Entity count (${entityCount + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`);
|
|
13952
|
-
|
|
13953
|
-
entities[entityName] = {
|
|
13954
|
-
regx: RegExp(`&${escaped};`, "g"),
|
|
13955
|
-
val: val
|
|
13956
|
-
};
|
|
13987
|
+
entities[entityName] = val;
|
|
13957
13988
|
entityCount++;
|
|
13958
13989
|
}
|
|
13959
13990
|
} else if (hasBody && hasSeq(xmlData, "!ELEMENT", i)) {
|
|
@@ -14642,6 +14673,1333 @@ and limitations under the License.
|
|
|
14642
14673
|
return null;
|
|
14643
14674
|
}
|
|
14644
14675
|
}
|
|
14676
|
+
const BASIC_LATIN = {
|
|
14677
|
+
amp: '&',
|
|
14678
|
+
AMP: '&',
|
|
14679
|
+
lt: '<',
|
|
14680
|
+
LT: '<',
|
|
14681
|
+
gt: '>',
|
|
14682
|
+
GT: '>',
|
|
14683
|
+
quot: '"',
|
|
14684
|
+
QUOT: '"',
|
|
14685
|
+
apos: "'",
|
|
14686
|
+
lsquo: '‘',
|
|
14687
|
+
rsquo: '’',
|
|
14688
|
+
ldquo: '“',
|
|
14689
|
+
rdquo: '”',
|
|
14690
|
+
lsquor: '‚',
|
|
14691
|
+
rsquor: '’',
|
|
14692
|
+
ldquor: '„',
|
|
14693
|
+
bdquo: '„',
|
|
14694
|
+
comma: ',',
|
|
14695
|
+
period: '.',
|
|
14696
|
+
colon: ':',
|
|
14697
|
+
semi: ';',
|
|
14698
|
+
excl: '!',
|
|
14699
|
+
quest: '?',
|
|
14700
|
+
num: '#',
|
|
14701
|
+
dollar: '$',
|
|
14702
|
+
percent: '%',
|
|
14703
|
+
amp: '&',
|
|
14704
|
+
ast: '*',
|
|
14705
|
+
commat: '@',
|
|
14706
|
+
lowbar: '_',
|
|
14707
|
+
verbar: '|',
|
|
14708
|
+
vert: '|',
|
|
14709
|
+
sol: '/',
|
|
14710
|
+
bsol: '\\',
|
|
14711
|
+
lbrace: '{',
|
|
14712
|
+
rbrace: '}',
|
|
14713
|
+
lbrack: '[',
|
|
14714
|
+
rbrack: ']',
|
|
14715
|
+
lpar: '(',
|
|
14716
|
+
rpar: ')',
|
|
14717
|
+
nbsp: '\u00a0',
|
|
14718
|
+
iexcl: '¡',
|
|
14719
|
+
cent: '¢',
|
|
14720
|
+
pound: '£',
|
|
14721
|
+
curren: '¤',
|
|
14722
|
+
yen: '¥',
|
|
14723
|
+
brvbar: '¦',
|
|
14724
|
+
sect: '§',
|
|
14725
|
+
uml: '¨',
|
|
14726
|
+
copy: '©',
|
|
14727
|
+
COPY: '©',
|
|
14728
|
+
ordf: 'ª',
|
|
14729
|
+
laquo: '«',
|
|
14730
|
+
not: '¬',
|
|
14731
|
+
shy: '\u00ad',
|
|
14732
|
+
reg: '®',
|
|
14733
|
+
REG: '®',
|
|
14734
|
+
macr: '¯',
|
|
14735
|
+
deg: '°',
|
|
14736
|
+
plusmn: '±',
|
|
14737
|
+
sup2: '²',
|
|
14738
|
+
sup3: '³',
|
|
14739
|
+
acute: '´',
|
|
14740
|
+
micro: 'µ',
|
|
14741
|
+
para: '¶',
|
|
14742
|
+
middot: '·',
|
|
14743
|
+
cedil: '¸',
|
|
14744
|
+
sup1: '¹',
|
|
14745
|
+
ordm: 'º',
|
|
14746
|
+
raquo: '»',
|
|
14747
|
+
frac14: '¼',
|
|
14748
|
+
frac12: '½',
|
|
14749
|
+
half: '½',
|
|
14750
|
+
frac34: '¾',
|
|
14751
|
+
iquest: '¿',
|
|
14752
|
+
times: '×',
|
|
14753
|
+
div: '÷',
|
|
14754
|
+
divide: '÷'
|
|
14755
|
+
};
|
|
14756
|
+
const LATIN_ACCENTS = {
|
|
14757
|
+
Agrave: 'À',
|
|
14758
|
+
agrave: 'à',
|
|
14759
|
+
Aacute: 'Á',
|
|
14760
|
+
aacute: 'á',
|
|
14761
|
+
Acirc: 'Â',
|
|
14762
|
+
acirc: 'â',
|
|
14763
|
+
Atilde: 'Ã',
|
|
14764
|
+
atilde: 'ã',
|
|
14765
|
+
Auml: 'Ä',
|
|
14766
|
+
auml: 'ä',
|
|
14767
|
+
Aring: 'Å',
|
|
14768
|
+
aring: 'å',
|
|
14769
|
+
AElig: 'Æ',
|
|
14770
|
+
aelig: 'æ',
|
|
14771
|
+
Ccedil: 'Ç',
|
|
14772
|
+
ccedil: 'ç',
|
|
14773
|
+
Egrave: 'È',
|
|
14774
|
+
egrave: 'è',
|
|
14775
|
+
Eacute: 'É',
|
|
14776
|
+
eacute: 'é',
|
|
14777
|
+
Ecirc: 'Ê',
|
|
14778
|
+
ecirc: 'ê',
|
|
14779
|
+
Euml: 'Ë',
|
|
14780
|
+
euml: 'ë',
|
|
14781
|
+
Igrave: 'Ì',
|
|
14782
|
+
igrave: 'ì',
|
|
14783
|
+
Iacute: 'Í',
|
|
14784
|
+
iacute: 'í',
|
|
14785
|
+
Icirc: 'Î',
|
|
14786
|
+
icirc: 'î',
|
|
14787
|
+
Iuml: 'Ï',
|
|
14788
|
+
iuml: 'ï',
|
|
14789
|
+
ETH: 'Ð',
|
|
14790
|
+
eth: 'ð',
|
|
14791
|
+
Ntilde: 'Ñ',
|
|
14792
|
+
ntilde: 'ñ',
|
|
14793
|
+
Ograve: 'Ò',
|
|
14794
|
+
ograve: 'ò',
|
|
14795
|
+
Oacute: 'Ó',
|
|
14796
|
+
oacute: 'ó',
|
|
14797
|
+
Ocirc: 'Ô',
|
|
14798
|
+
ocirc: 'ô',
|
|
14799
|
+
Otilde: 'Õ',
|
|
14800
|
+
otilde: 'õ',
|
|
14801
|
+
Ouml: 'Ö',
|
|
14802
|
+
ouml: 'ö',
|
|
14803
|
+
Oslash: 'Ø',
|
|
14804
|
+
oslash: 'ø',
|
|
14805
|
+
Ugrave: 'Ù',
|
|
14806
|
+
ugrave: 'ù',
|
|
14807
|
+
Uacute: 'Ú',
|
|
14808
|
+
uacute: 'ú',
|
|
14809
|
+
Ucirc: 'Û',
|
|
14810
|
+
ucirc: 'û',
|
|
14811
|
+
Uuml: 'Ü',
|
|
14812
|
+
uuml: 'ü',
|
|
14813
|
+
Yacute: 'Ý',
|
|
14814
|
+
yacute: 'ý',
|
|
14815
|
+
THORN: 'Þ',
|
|
14816
|
+
thorn: 'þ',
|
|
14817
|
+
szlig: 'ß',
|
|
14818
|
+
yuml: 'ÿ',
|
|
14819
|
+
Yuml: 'Ÿ'
|
|
14820
|
+
};
|
|
14821
|
+
const LATIN_EXTENDED = {
|
|
14822
|
+
Amacr: 'Ā',
|
|
14823
|
+
amacr: 'ā',
|
|
14824
|
+
Abreve: 'Ă',
|
|
14825
|
+
abreve: 'ă',
|
|
14826
|
+
Aogon: 'Ą',
|
|
14827
|
+
aogon: 'ą',
|
|
14828
|
+
Cacute: 'Ć',
|
|
14829
|
+
cacute: 'ć',
|
|
14830
|
+
Ccirc: 'Ĉ',
|
|
14831
|
+
ccirc: 'ĉ',
|
|
14832
|
+
Cdot: 'Ċ',
|
|
14833
|
+
cdot: 'ċ',
|
|
14834
|
+
Ccaron: 'Č',
|
|
14835
|
+
ccaron: 'č',
|
|
14836
|
+
Dcaron: 'Ď',
|
|
14837
|
+
dcaron: 'ď',
|
|
14838
|
+
Dstrok: 'Đ',
|
|
14839
|
+
dstrok: 'đ',
|
|
14840
|
+
Emacr: 'Ē',
|
|
14841
|
+
emacr: 'ē',
|
|
14842
|
+
Ecaron: 'Ě',
|
|
14843
|
+
ecaron: 'ě',
|
|
14844
|
+
Edot: 'Ė',
|
|
14845
|
+
edot: 'ė',
|
|
14846
|
+
Eogon: 'Ę',
|
|
14847
|
+
eogon: 'ę',
|
|
14848
|
+
Gcirc: 'Ĝ',
|
|
14849
|
+
gcirc: 'ĝ',
|
|
14850
|
+
Gbreve: 'Ğ',
|
|
14851
|
+
gbreve: 'ğ',
|
|
14852
|
+
Gdot: 'Ġ',
|
|
14853
|
+
gdot: 'ġ',
|
|
14854
|
+
Gcedil: 'Ģ',
|
|
14855
|
+
Hcirc: 'Ĥ',
|
|
14856
|
+
hcirc: 'ĥ',
|
|
14857
|
+
Hstrok: 'Ħ',
|
|
14858
|
+
hstrok: 'ħ',
|
|
14859
|
+
Itilde: 'Ĩ',
|
|
14860
|
+
itilde: 'ĩ',
|
|
14861
|
+
Imacr: 'Ī',
|
|
14862
|
+
imacr: 'ī',
|
|
14863
|
+
Iogon: 'Į',
|
|
14864
|
+
iogon: 'į',
|
|
14865
|
+
Idot: 'İ',
|
|
14866
|
+
IJlig: 'IJ',
|
|
14867
|
+
ijlig: 'ij',
|
|
14868
|
+
Jcirc: 'Ĵ',
|
|
14869
|
+
jcirc: 'ĵ',
|
|
14870
|
+
Kcedil: 'Ķ',
|
|
14871
|
+
kcedil: 'ķ',
|
|
14872
|
+
kgreen: 'ĸ',
|
|
14873
|
+
Lacute: 'Ĺ',
|
|
14874
|
+
lacute: 'ĺ',
|
|
14875
|
+
Lcedil: 'Ļ',
|
|
14876
|
+
lcedil: 'ļ',
|
|
14877
|
+
Lcaron: 'Ľ',
|
|
14878
|
+
lcaron: 'ľ',
|
|
14879
|
+
Lmidot: 'Ŀ',
|
|
14880
|
+
lmidot: 'ŀ',
|
|
14881
|
+
Lstrok: 'Ł',
|
|
14882
|
+
lstrok: 'ł',
|
|
14883
|
+
Nacute: 'Ń',
|
|
14884
|
+
nacute: 'ń',
|
|
14885
|
+
Ncaron: 'Ň',
|
|
14886
|
+
ncaron: 'ň',
|
|
14887
|
+
Ncedil: 'Ņ',
|
|
14888
|
+
ncedil: 'ņ',
|
|
14889
|
+
ENG: 'Ŋ',
|
|
14890
|
+
eng: 'ŋ',
|
|
14891
|
+
Omacr: 'Ō',
|
|
14892
|
+
omacr: 'ō',
|
|
14893
|
+
Odblac: 'Ő',
|
|
14894
|
+
odblac: 'ő',
|
|
14895
|
+
OElig: 'Œ',
|
|
14896
|
+
oelig: 'œ',
|
|
14897
|
+
Racute: 'Ŕ',
|
|
14898
|
+
racute: 'ŕ',
|
|
14899
|
+
Rcaron: 'Ř',
|
|
14900
|
+
rcaron: 'ř',
|
|
14901
|
+
Rcedil: 'Ŗ',
|
|
14902
|
+
rcedil: 'ŗ',
|
|
14903
|
+
Sacute: 'Ś',
|
|
14904
|
+
sacute: 'ś',
|
|
14905
|
+
Scirc: 'Ŝ',
|
|
14906
|
+
scirc: 'ŝ',
|
|
14907
|
+
Scedil: 'Ş',
|
|
14908
|
+
scedil: 'ş',
|
|
14909
|
+
Scaron: 'Š',
|
|
14910
|
+
scaron: 'š',
|
|
14911
|
+
Tcedil: 'Ţ',
|
|
14912
|
+
tcedil: 'ţ',
|
|
14913
|
+
Tcaron: 'Ť',
|
|
14914
|
+
tcaron: 'ť',
|
|
14915
|
+
Tstrok: 'Ŧ',
|
|
14916
|
+
tstrok: 'ŧ',
|
|
14917
|
+
Utilde: 'Ũ',
|
|
14918
|
+
utilde: 'ũ',
|
|
14919
|
+
Umacr: 'Ū',
|
|
14920
|
+
umacr: 'ū',
|
|
14921
|
+
Ubreve: 'Ŭ',
|
|
14922
|
+
ubreve: 'ŭ',
|
|
14923
|
+
Uring: 'Ů',
|
|
14924
|
+
uring: 'ů',
|
|
14925
|
+
Udblac: 'Ű',
|
|
14926
|
+
udblac: 'ű',
|
|
14927
|
+
Uogon: 'Ų',
|
|
14928
|
+
uogon: 'ų',
|
|
14929
|
+
Wcirc: 'Ŵ',
|
|
14930
|
+
wcirc: 'ŵ',
|
|
14931
|
+
Ycirc: 'Ŷ',
|
|
14932
|
+
ycirc: 'ŷ',
|
|
14933
|
+
Zacute: 'Ź',
|
|
14934
|
+
zacute: 'ź',
|
|
14935
|
+
Zdot: 'Ż',
|
|
14936
|
+
zdot: 'ż',
|
|
14937
|
+
Zcaron: 'Ž',
|
|
14938
|
+
zcaron: 'ž'
|
|
14939
|
+
};
|
|
14940
|
+
const GREEK = {
|
|
14941
|
+
Alpha: 'Α',
|
|
14942
|
+
alpha: 'α',
|
|
14943
|
+
Beta: 'Β',
|
|
14944
|
+
beta: 'β',
|
|
14945
|
+
Gamma: 'Γ',
|
|
14946
|
+
gamma: 'γ',
|
|
14947
|
+
Delta: 'Δ',
|
|
14948
|
+
delta: 'δ',
|
|
14949
|
+
Epsilon: 'Ε',
|
|
14950
|
+
epsilon: 'ε',
|
|
14951
|
+
epsiv: 'ϵ',
|
|
14952
|
+
varepsilon: 'ϵ',
|
|
14953
|
+
Zeta: 'Ζ',
|
|
14954
|
+
zeta: 'ζ',
|
|
14955
|
+
Eta: 'Η',
|
|
14956
|
+
eta: 'η',
|
|
14957
|
+
Theta: 'Θ',
|
|
14958
|
+
theta: 'θ',
|
|
14959
|
+
thetasym: 'ϑ',
|
|
14960
|
+
vartheta: 'ϑ',
|
|
14961
|
+
Iota: 'Ι',
|
|
14962
|
+
iota: 'ι',
|
|
14963
|
+
Kappa: 'Κ',
|
|
14964
|
+
kappa: 'κ',
|
|
14965
|
+
kappav: 'ϰ',
|
|
14966
|
+
varkappa: 'ϰ',
|
|
14967
|
+
Lambda: 'Λ',
|
|
14968
|
+
lambda: 'λ',
|
|
14969
|
+
Mu: 'Μ',
|
|
14970
|
+
mu: 'μ',
|
|
14971
|
+
Nu: 'Ν',
|
|
14972
|
+
nu: 'ν',
|
|
14973
|
+
Xi: 'Ξ',
|
|
14974
|
+
xi: 'ξ',
|
|
14975
|
+
Omicron: 'Ο',
|
|
14976
|
+
omicron: 'ο',
|
|
14977
|
+
Pi: 'Π',
|
|
14978
|
+
pi: 'π',
|
|
14979
|
+
piv: 'ϖ',
|
|
14980
|
+
varpi: 'ϖ',
|
|
14981
|
+
Rho: 'Ρ',
|
|
14982
|
+
rho: 'ρ',
|
|
14983
|
+
rhov: 'ϱ',
|
|
14984
|
+
varrho: 'ϱ',
|
|
14985
|
+
Sigma: 'Σ',
|
|
14986
|
+
sigma: 'σ',
|
|
14987
|
+
sigmaf: 'ς',
|
|
14988
|
+
sigmav: 'ς',
|
|
14989
|
+
varsigma: 'ς',
|
|
14990
|
+
Tau: 'Τ',
|
|
14991
|
+
tau: 'τ',
|
|
14992
|
+
Upsilon: 'Υ',
|
|
14993
|
+
upsilon: 'υ',
|
|
14994
|
+
upsi: 'υ',
|
|
14995
|
+
Upsi: 'ϒ',
|
|
14996
|
+
upsih: 'ϒ',
|
|
14997
|
+
Phi: 'Φ',
|
|
14998
|
+
phi: 'φ',
|
|
14999
|
+
phiv: 'ϕ',
|
|
15000
|
+
varphi: 'ϕ',
|
|
15001
|
+
Chi: 'Χ',
|
|
15002
|
+
chi: 'χ',
|
|
15003
|
+
Psi: 'Ψ',
|
|
15004
|
+
psi: 'ψ',
|
|
15005
|
+
Omega: 'Ω',
|
|
15006
|
+
omega: 'ω',
|
|
15007
|
+
ohm: 'Ω',
|
|
15008
|
+
Gammad: 'Ϝ',
|
|
15009
|
+
gammad: 'ϝ',
|
|
15010
|
+
digamma: 'ϝ'
|
|
15011
|
+
};
|
|
15012
|
+
const CYRILLIC = {
|
|
15013
|
+
Afr: '𝔄',
|
|
15014
|
+
afr: '𝔞',
|
|
15015
|
+
Acy: 'А',
|
|
15016
|
+
acy: 'а',
|
|
15017
|
+
Bcy: 'Б',
|
|
15018
|
+
bcy: 'б',
|
|
15019
|
+
Vcy: 'В',
|
|
15020
|
+
vcy: 'в',
|
|
15021
|
+
Gcy: 'Г',
|
|
15022
|
+
gcy: 'г',
|
|
15023
|
+
Dcy: 'Д',
|
|
15024
|
+
dcy: 'д',
|
|
15025
|
+
IEcy: 'Е',
|
|
15026
|
+
iecy: 'е',
|
|
15027
|
+
IOcy: 'Ё',
|
|
15028
|
+
iocy: 'ё',
|
|
15029
|
+
ZHcy: 'Ж',
|
|
15030
|
+
zhcy: 'ж',
|
|
15031
|
+
Zcy: 'З',
|
|
15032
|
+
zcy: 'з',
|
|
15033
|
+
Icy: 'И',
|
|
15034
|
+
icy: 'и',
|
|
15035
|
+
Jcy: 'Й',
|
|
15036
|
+
jcy: 'й',
|
|
15037
|
+
Kcy: 'К',
|
|
15038
|
+
kcy: 'к',
|
|
15039
|
+
Lcy: 'Л',
|
|
15040
|
+
lcy: 'л',
|
|
15041
|
+
Mcy: 'М',
|
|
15042
|
+
mcy: 'м',
|
|
15043
|
+
Ncy: 'Н',
|
|
15044
|
+
ncy: 'н',
|
|
15045
|
+
Ocy: 'О',
|
|
15046
|
+
ocy: 'о',
|
|
15047
|
+
Pcy: 'П',
|
|
15048
|
+
pcy: 'п',
|
|
15049
|
+
Rcy: 'Р',
|
|
15050
|
+
rcy: 'р',
|
|
15051
|
+
Scy: 'С',
|
|
15052
|
+
scy: 'с',
|
|
15053
|
+
Tcy: 'Т',
|
|
15054
|
+
tcy: 'т',
|
|
15055
|
+
Ucy: 'У',
|
|
15056
|
+
ucy: 'у',
|
|
15057
|
+
Fcy: 'Ф',
|
|
15058
|
+
fcy: 'ф',
|
|
15059
|
+
KHcy: 'Х',
|
|
15060
|
+
khcy: 'х',
|
|
15061
|
+
TScy: 'Ц',
|
|
15062
|
+
tscy: 'ц',
|
|
15063
|
+
CHcy: 'Ч',
|
|
15064
|
+
chcy: 'ч',
|
|
15065
|
+
SHcy: 'Ш',
|
|
15066
|
+
shcy: 'ш',
|
|
15067
|
+
SHCHcy: 'Щ',
|
|
15068
|
+
shchcy: 'щ',
|
|
15069
|
+
HARDcy: 'Ъ',
|
|
15070
|
+
hardcy: 'ъ',
|
|
15071
|
+
Ycy: 'Ы',
|
|
15072
|
+
ycy: 'ы',
|
|
15073
|
+
SOFTcy: 'Ь',
|
|
15074
|
+
softcy: 'ь',
|
|
15075
|
+
Ecy: 'Э',
|
|
15076
|
+
ecy: 'э',
|
|
15077
|
+
YUcy: 'Ю',
|
|
15078
|
+
yucy: 'ю',
|
|
15079
|
+
YAcy: 'Я',
|
|
15080
|
+
yacy: 'я',
|
|
15081
|
+
DJcy: 'Ђ',
|
|
15082
|
+
djcy: 'ђ',
|
|
15083
|
+
GJcy: 'Ѓ',
|
|
15084
|
+
gjcy: 'ѓ',
|
|
15085
|
+
Jukcy: 'Є',
|
|
15086
|
+
jukcy: 'є',
|
|
15087
|
+
DScy: 'Ѕ',
|
|
15088
|
+
dscy: 'ѕ',
|
|
15089
|
+
Iukcy: 'І',
|
|
15090
|
+
iukcy: 'і',
|
|
15091
|
+
YIcy: 'Ї',
|
|
15092
|
+
yicy: 'ї',
|
|
15093
|
+
Jsercy: 'Ј',
|
|
15094
|
+
jsercy: 'ј',
|
|
15095
|
+
LJcy: 'Љ',
|
|
15096
|
+
ljcy: 'љ',
|
|
15097
|
+
NJcy: 'Њ',
|
|
15098
|
+
njcy: 'њ',
|
|
15099
|
+
TSHcy: 'Ћ',
|
|
15100
|
+
tshcy: 'ћ',
|
|
15101
|
+
KJcy: 'Ќ',
|
|
15102
|
+
kjcy: 'ќ',
|
|
15103
|
+
Ubrcy: 'Ў',
|
|
15104
|
+
ubrcy: 'ў',
|
|
15105
|
+
DZcy: 'Џ',
|
|
15106
|
+
dzcy: 'џ'
|
|
15107
|
+
};
|
|
15108
|
+
const MATH = {
|
|
15109
|
+
plus: '+',
|
|
15110
|
+
minus: '−',
|
|
15111
|
+
mnplus: '∓',
|
|
15112
|
+
mp: '∓',
|
|
15113
|
+
pm: '±',
|
|
15114
|
+
times: '×',
|
|
15115
|
+
div: '÷',
|
|
15116
|
+
divide: '÷',
|
|
15117
|
+
sdot: '⋅',
|
|
15118
|
+
star: '☆',
|
|
15119
|
+
starf: '★',
|
|
15120
|
+
bigstar: '★',
|
|
15121
|
+
lowast: '∗',
|
|
15122
|
+
ast: '*',
|
|
15123
|
+
midast: '*',
|
|
15124
|
+
compfn: '∘',
|
|
15125
|
+
smallcircle: '∘',
|
|
15126
|
+
bullet: '•',
|
|
15127
|
+
bull: '•',
|
|
15128
|
+
nbsp: '\u00a0',
|
|
15129
|
+
hellip: '…',
|
|
15130
|
+
mldr: '…',
|
|
15131
|
+
prime: '′',
|
|
15132
|
+
Prime: '″',
|
|
15133
|
+
tprime: '‴',
|
|
15134
|
+
bprime: '‵',
|
|
15135
|
+
backprime: '‵',
|
|
15136
|
+
minus: '−',
|
|
15137
|
+
minusd: '∸',
|
|
15138
|
+
dotminus: '∸',
|
|
15139
|
+
plusdo: '∔',
|
|
15140
|
+
dotplus: '∔',
|
|
15141
|
+
plusmn: '±',
|
|
15142
|
+
minusplus: '∓',
|
|
15143
|
+
mnplus: '∓',
|
|
15144
|
+
mp: '∓',
|
|
15145
|
+
setminus: '∖',
|
|
15146
|
+
smallsetminus: '∖',
|
|
15147
|
+
Backslash: '∖',
|
|
15148
|
+
setmn: '∖',
|
|
15149
|
+
ssetmn: '∖',
|
|
15150
|
+
lowbar: '_',
|
|
15151
|
+
verbar: '|',
|
|
15152
|
+
vert: '|',
|
|
15153
|
+
VerticalLine: '|',
|
|
15154
|
+
colon: ':',
|
|
15155
|
+
Colon: '∷',
|
|
15156
|
+
Proportion: '∷',
|
|
15157
|
+
ratio: '∶',
|
|
15158
|
+
equals: '=',
|
|
15159
|
+
ne: '≠',
|
|
15160
|
+
nequiv: '≢',
|
|
15161
|
+
equiv: '≡',
|
|
15162
|
+
Congruent: '≡',
|
|
15163
|
+
sim: '∼',
|
|
15164
|
+
thicksim: '∼',
|
|
15165
|
+
thksim: '∼',
|
|
15166
|
+
sime: '≃',
|
|
15167
|
+
simeq: '≃',
|
|
15168
|
+
TildeEqual: '≃',
|
|
15169
|
+
asymp: '≈',
|
|
15170
|
+
approx: '≈',
|
|
15171
|
+
thickapprox: '≈',
|
|
15172
|
+
thkap: '≈',
|
|
15173
|
+
TildeTilde: '≈',
|
|
15174
|
+
ncong: '≇',
|
|
15175
|
+
cong: '≅',
|
|
15176
|
+
TildeFullEqual: '≅',
|
|
15177
|
+
asympeq: '≍',
|
|
15178
|
+
CupCap: '≍',
|
|
15179
|
+
bump: '≎',
|
|
15180
|
+
Bumpeq: '≎',
|
|
15181
|
+
HumpDownHump: '≎',
|
|
15182
|
+
bumpe: '≏',
|
|
15183
|
+
bumpeq: '≏',
|
|
15184
|
+
HumpEqual: '≏',
|
|
15185
|
+
dotminus: '∸',
|
|
15186
|
+
minusd: '∸',
|
|
15187
|
+
plusdo: '∔',
|
|
15188
|
+
dotplus: '∔',
|
|
15189
|
+
le: '≤',
|
|
15190
|
+
LessEqual: '≤',
|
|
15191
|
+
ge: '≥',
|
|
15192
|
+
GreaterEqual: '≥',
|
|
15193
|
+
lesseqgtr: '⋚',
|
|
15194
|
+
lesseqqgtr: '⪋',
|
|
15195
|
+
greater: '>',
|
|
15196
|
+
less: '<'
|
|
15197
|
+
};
|
|
15198
|
+
const MATH_ADVANCED = {
|
|
15199
|
+
alefsym: 'ℵ',
|
|
15200
|
+
aleph: 'ℵ',
|
|
15201
|
+
beth: 'ℶ',
|
|
15202
|
+
gimel: 'ℷ',
|
|
15203
|
+
daleth: 'ℸ',
|
|
15204
|
+
forall: '∀',
|
|
15205
|
+
ForAll: '∀',
|
|
15206
|
+
part: '∂',
|
|
15207
|
+
PartialD: '∂',
|
|
15208
|
+
exist: '∃',
|
|
15209
|
+
Exists: '∃',
|
|
15210
|
+
nexist: '∄',
|
|
15211
|
+
nexists: '∄',
|
|
15212
|
+
empty: '∅',
|
|
15213
|
+
emptyset: '∅',
|
|
15214
|
+
emptyv: '∅',
|
|
15215
|
+
varnothing: '∅',
|
|
15216
|
+
nabla: '∇',
|
|
15217
|
+
Del: '∇',
|
|
15218
|
+
isin: '∈',
|
|
15219
|
+
isinv: '∈',
|
|
15220
|
+
in: '∈',
|
|
15221
|
+
Element: '∈',
|
|
15222
|
+
notin: '∉',
|
|
15223
|
+
notinva: '∉',
|
|
15224
|
+
ni: '∋',
|
|
15225
|
+
niv: '∋',
|
|
15226
|
+
SuchThat: '∋',
|
|
15227
|
+
ReverseElement: '∋',
|
|
15228
|
+
notni: '∌',
|
|
15229
|
+
notniva: '∌',
|
|
15230
|
+
prod: '∏',
|
|
15231
|
+
Product: '∏',
|
|
15232
|
+
coprod: '∐',
|
|
15233
|
+
Coproduct: '∐',
|
|
15234
|
+
sum: '∑',
|
|
15235
|
+
Sum: '∑',
|
|
15236
|
+
minus: '−',
|
|
15237
|
+
mp: '∓',
|
|
15238
|
+
plusdo: '∔',
|
|
15239
|
+
dotplus: '∔',
|
|
15240
|
+
setminus: '∖',
|
|
15241
|
+
lowast: '∗',
|
|
15242
|
+
radic: '√',
|
|
15243
|
+
Sqrt: '√',
|
|
15244
|
+
prop: '∝',
|
|
15245
|
+
propto: '∝',
|
|
15246
|
+
Proportional: '∝',
|
|
15247
|
+
varpropto: '∝',
|
|
15248
|
+
infin: '∞',
|
|
15249
|
+
infintie: '⧝',
|
|
15250
|
+
ang: '∠',
|
|
15251
|
+
angle: '∠',
|
|
15252
|
+
angmsd: '∡',
|
|
15253
|
+
measuredangle: '∡',
|
|
15254
|
+
angsph: '∢',
|
|
15255
|
+
mid: '∣',
|
|
15256
|
+
VerticalBar: '∣',
|
|
15257
|
+
nmid: '∤',
|
|
15258
|
+
nsmid: '∤',
|
|
15259
|
+
npar: '∦',
|
|
15260
|
+
parallel: '∥',
|
|
15261
|
+
spar: '∥',
|
|
15262
|
+
nparallel: '∦',
|
|
15263
|
+
nspar: '∦',
|
|
15264
|
+
and: '∧',
|
|
15265
|
+
wedge: '∧',
|
|
15266
|
+
or: '∨',
|
|
15267
|
+
vee: '∨',
|
|
15268
|
+
cap: '∩',
|
|
15269
|
+
cup: '∪',
|
|
15270
|
+
int: '∫',
|
|
15271
|
+
Integral: '∫',
|
|
15272
|
+
conint: '∮',
|
|
15273
|
+
ContourIntegral: '∮',
|
|
15274
|
+
Conint: '∯',
|
|
15275
|
+
DoubleContourIntegral: '∯',
|
|
15276
|
+
Cconint: '∰',
|
|
15277
|
+
there4: '∴',
|
|
15278
|
+
therefore: '∴',
|
|
15279
|
+
Therefore: '∴',
|
|
15280
|
+
becaus: '∵',
|
|
15281
|
+
because: '∵',
|
|
15282
|
+
Because: '∵',
|
|
15283
|
+
ratio: '∶',
|
|
15284
|
+
Proportion: '∷',
|
|
15285
|
+
minusd: '∸',
|
|
15286
|
+
dotminus: '∸',
|
|
15287
|
+
mDDot: '∺',
|
|
15288
|
+
homtht: '∻',
|
|
15289
|
+
sim: '∼',
|
|
15290
|
+
bsimg: '∽',
|
|
15291
|
+
backsim: '∽',
|
|
15292
|
+
ac: '∾',
|
|
15293
|
+
mstpos: '∾',
|
|
15294
|
+
acd: '∿',
|
|
15295
|
+
VerticalTilde: '≀',
|
|
15296
|
+
wr: '≀',
|
|
15297
|
+
wreath: '≀',
|
|
15298
|
+
nsime: '≄',
|
|
15299
|
+
nsimeq: '≄',
|
|
15300
|
+
nsimeq: '≄',
|
|
15301
|
+
ncong: '≇',
|
|
15302
|
+
simne: '≆',
|
|
15303
|
+
ncongdot: '⩭̸',
|
|
15304
|
+
ngsim: '≵',
|
|
15305
|
+
nsim: '≁',
|
|
15306
|
+
napprox: '≉',
|
|
15307
|
+
nap: '≉',
|
|
15308
|
+
ngeq: '≱',
|
|
15309
|
+
nge: '≱',
|
|
15310
|
+
nleq: '≰',
|
|
15311
|
+
nle: '≰',
|
|
15312
|
+
ngtr: '≯',
|
|
15313
|
+
ngt: '≯',
|
|
15314
|
+
nless: '≮',
|
|
15315
|
+
nlt: '≮',
|
|
15316
|
+
nprec: '⊀',
|
|
15317
|
+
npr: '⊀',
|
|
15318
|
+
nsucc: '⊁',
|
|
15319
|
+
nsc: '⊁'
|
|
15320
|
+
};
|
|
15321
|
+
const ARROWS = {
|
|
15322
|
+
larr: '←',
|
|
15323
|
+
leftarrow: '←',
|
|
15324
|
+
LeftArrow: '←',
|
|
15325
|
+
uarr: '↑',
|
|
15326
|
+
uparrow: '↑',
|
|
15327
|
+
UpArrow: '↑',
|
|
15328
|
+
rarr: '→',
|
|
15329
|
+
rightarrow: '→',
|
|
15330
|
+
RightArrow: '→',
|
|
15331
|
+
darr: '↓',
|
|
15332
|
+
downarrow: '↓',
|
|
15333
|
+
DownArrow: '↓',
|
|
15334
|
+
harr: '↔',
|
|
15335
|
+
leftrightarrow: '↔',
|
|
15336
|
+
LeftRightArrow: '↔',
|
|
15337
|
+
varr: '↕',
|
|
15338
|
+
updownarrow: '↕',
|
|
15339
|
+
UpDownArrow: '↕',
|
|
15340
|
+
nwarr: '↖',
|
|
15341
|
+
nwarrow: '↖',
|
|
15342
|
+
UpperLeftArrow: '↖',
|
|
15343
|
+
nearr: '↗',
|
|
15344
|
+
nearrow: '↗',
|
|
15345
|
+
UpperRightArrow: '↗',
|
|
15346
|
+
searr: '↘',
|
|
15347
|
+
searrow: '↘',
|
|
15348
|
+
LowerRightArrow: '↘',
|
|
15349
|
+
swarr: '↙',
|
|
15350
|
+
swarrow: '↙',
|
|
15351
|
+
LowerLeftArrow: '↙',
|
|
15352
|
+
lArr: '⇐',
|
|
15353
|
+
Leftarrow: '⇐',
|
|
15354
|
+
uArr: '⇑',
|
|
15355
|
+
Uparrow: '⇑',
|
|
15356
|
+
rArr: '⇒',
|
|
15357
|
+
Rightarrow: '⇒',
|
|
15358
|
+
dArr: '⇓',
|
|
15359
|
+
Downarrow: '⇓',
|
|
15360
|
+
hArr: '⇔',
|
|
15361
|
+
Leftrightarrow: '⇔',
|
|
15362
|
+
iff: '⇔',
|
|
15363
|
+
vArr: '⇕',
|
|
15364
|
+
Updownarrow: '⇕',
|
|
15365
|
+
lAarr: '⇚',
|
|
15366
|
+
Lleftarrow: '⇚',
|
|
15367
|
+
rAarr: '⇛',
|
|
15368
|
+
Rrightarrow: '⇛',
|
|
15369
|
+
lrarr: '⇆',
|
|
15370
|
+
leftrightarrows: '⇆',
|
|
15371
|
+
rlarr: '⇄',
|
|
15372
|
+
rightleftarrows: '⇄',
|
|
15373
|
+
lrhar: '⇋',
|
|
15374
|
+
leftrightharpoons: '⇋',
|
|
15375
|
+
ReverseEquilibrium: '⇋',
|
|
15376
|
+
rlhar: '⇌',
|
|
15377
|
+
rightleftharpoons: '⇌',
|
|
15378
|
+
Equilibrium: '⇌',
|
|
15379
|
+
udarr: '⇅',
|
|
15380
|
+
UpArrowDownArrow: '⇅',
|
|
15381
|
+
duarr: '⇵',
|
|
15382
|
+
DownArrowUpArrow: '⇵',
|
|
15383
|
+
llarr: '⇇',
|
|
15384
|
+
leftleftarrows: '⇇',
|
|
15385
|
+
rrarr: '⇉',
|
|
15386
|
+
rightrightarrows: '⇉',
|
|
15387
|
+
ddarr: '⇊',
|
|
15388
|
+
downdownarrows: '⇊',
|
|
15389
|
+
har: '↽',
|
|
15390
|
+
lhard: '↽',
|
|
15391
|
+
leftharpoondown: '↽',
|
|
15392
|
+
lharu: '↼',
|
|
15393
|
+
leftharpoonup: '↼',
|
|
15394
|
+
rhard: '⇁',
|
|
15395
|
+
rightharpoondown: '⇁',
|
|
15396
|
+
rharu: '⇀',
|
|
15397
|
+
rightharpoonup: '⇀',
|
|
15398
|
+
lsh: '↰',
|
|
15399
|
+
Lsh: '↰',
|
|
15400
|
+
rsh: '↱',
|
|
15401
|
+
Rsh: '↱',
|
|
15402
|
+
ldsh: '↲',
|
|
15403
|
+
rdsh: '↳',
|
|
15404
|
+
hookleftarrow: '↩',
|
|
15405
|
+
hookrightarrow: '↪',
|
|
15406
|
+
mapstoleft: '↤',
|
|
15407
|
+
mapstoup: '↥',
|
|
15408
|
+
map: '↦',
|
|
15409
|
+
mapsto: '↦',
|
|
15410
|
+
mapstodown: '↧',
|
|
15411
|
+
crarr: '↵',
|
|
15412
|
+
nwarrow: '↖',
|
|
15413
|
+
nearrow: '↗',
|
|
15414
|
+
searrow: '↘',
|
|
15415
|
+
swarrow: '↙',
|
|
15416
|
+
nleftarrow: '↚',
|
|
15417
|
+
nleftrightarrow: '↮',
|
|
15418
|
+
nrightarrow: '↛',
|
|
15419
|
+
nrarr: '↛',
|
|
15420
|
+
larrtl: '↢',
|
|
15421
|
+
rarrtl: '↣',
|
|
15422
|
+
leftarrowtail: '↢',
|
|
15423
|
+
rightarrowtail: '↣',
|
|
15424
|
+
twoheadleftarrow: '↞',
|
|
15425
|
+
twoheadrightarrow: '↠',
|
|
15426
|
+
Larr: '↞',
|
|
15427
|
+
Rarr: '↠',
|
|
15428
|
+
larrhk: '↩',
|
|
15429
|
+
rarrhk: '↪',
|
|
15430
|
+
larrlp: '↫',
|
|
15431
|
+
looparrowleft: '↫',
|
|
15432
|
+
rarrlp: '↬',
|
|
15433
|
+
looparrowright: '↬',
|
|
15434
|
+
harrw: '↭',
|
|
15435
|
+
leftrightsquigarrow: '↭',
|
|
15436
|
+
nrarrw: '↝̸',
|
|
15437
|
+
rarrw: '↝',
|
|
15438
|
+
rightsquigarrow: '↝',
|
|
15439
|
+
larrbfs: '⤟',
|
|
15440
|
+
rarrbfs: '⤠',
|
|
15441
|
+
nvHarr: '⤄',
|
|
15442
|
+
nvlArr: '⤂',
|
|
15443
|
+
nvrArr: '⤃',
|
|
15444
|
+
larrfs: '⤝',
|
|
15445
|
+
rarrfs: '⤞',
|
|
15446
|
+
Map: '⤅',
|
|
15447
|
+
larrsim: '⥳',
|
|
15448
|
+
rarrsim: '⥴',
|
|
15449
|
+
harrcir: '⥈',
|
|
15450
|
+
Uarrocir: '⥉',
|
|
15451
|
+
lurdshar: '⥊',
|
|
15452
|
+
ldrdhar: '⥧',
|
|
15453
|
+
ldrushar: '⥋',
|
|
15454
|
+
rdldhar: '⥩',
|
|
15455
|
+
lrhard: '⥭',
|
|
15456
|
+
rlhar: '⇌',
|
|
15457
|
+
uharr: '↾',
|
|
15458
|
+
uharl: '↿',
|
|
15459
|
+
dharr: '⇂',
|
|
15460
|
+
dharl: '⇃',
|
|
15461
|
+
Uarr: '↟',
|
|
15462
|
+
Darr: '↡',
|
|
15463
|
+
zigrarr: '⇝',
|
|
15464
|
+
nwArr: '⇖',
|
|
15465
|
+
neArr: '⇗',
|
|
15466
|
+
seArr: '⇘',
|
|
15467
|
+
swArr: '⇙',
|
|
15468
|
+
nharr: '↮',
|
|
15469
|
+
nhArr: '⇎',
|
|
15470
|
+
nlarr: '↚',
|
|
15471
|
+
nlArr: '⇍',
|
|
15472
|
+
nrarr: '↛',
|
|
15473
|
+
nrArr: '⇏',
|
|
15474
|
+
larrb: '⇤',
|
|
15475
|
+
LeftArrowBar: '⇤',
|
|
15476
|
+
rarrb: '⇥',
|
|
15477
|
+
RightArrowBar: '⇥'
|
|
15478
|
+
};
|
|
15479
|
+
const SHAPES = {
|
|
15480
|
+
square: '□',
|
|
15481
|
+
Square: '□',
|
|
15482
|
+
squ: '□',
|
|
15483
|
+
squf: '▪',
|
|
15484
|
+
squarf: '▪',
|
|
15485
|
+
blacksquar: '▪',
|
|
15486
|
+
blacksquare: '▪',
|
|
15487
|
+
FilledVerySmallSquare: '▪',
|
|
15488
|
+
blk34: '▓',
|
|
15489
|
+
blk12: '▒',
|
|
15490
|
+
blk14: '░',
|
|
15491
|
+
block: '█',
|
|
15492
|
+
srect: '▭',
|
|
15493
|
+
rect: '▭',
|
|
15494
|
+
sdot: '⋅',
|
|
15495
|
+
sdotb: '⊡',
|
|
15496
|
+
dotsquare: '⊡',
|
|
15497
|
+
triangle: '▵',
|
|
15498
|
+
tri: '▵',
|
|
15499
|
+
trine: '▵',
|
|
15500
|
+
utri: '▵',
|
|
15501
|
+
triangledown: '▿',
|
|
15502
|
+
dtri: '▿',
|
|
15503
|
+
tridown: '▿',
|
|
15504
|
+
triangleleft: '◃',
|
|
15505
|
+
ltri: '◃',
|
|
15506
|
+
triangleright: '▹',
|
|
15507
|
+
rtri: '▹',
|
|
15508
|
+
blacktriangle: '▴',
|
|
15509
|
+
utrif: '▴',
|
|
15510
|
+
blacktriangledown: '▾',
|
|
15511
|
+
dtrif: '▾',
|
|
15512
|
+
blacktriangleleft: '◂',
|
|
15513
|
+
ltrif: '◂',
|
|
15514
|
+
blacktriangleright: '▸',
|
|
15515
|
+
rtrif: '▸',
|
|
15516
|
+
loz: '◊',
|
|
15517
|
+
lozenge: '◊',
|
|
15518
|
+
blacklozenge: '⧫',
|
|
15519
|
+
lozf: '⧫',
|
|
15520
|
+
bigcirc: '◯',
|
|
15521
|
+
xcirc: '◯',
|
|
15522
|
+
circ: 'ˆ',
|
|
15523
|
+
Circle: '○',
|
|
15524
|
+
cir: '○',
|
|
15525
|
+
o: '○',
|
|
15526
|
+
bullet: '•',
|
|
15527
|
+
bull: '•',
|
|
15528
|
+
hellip: '…',
|
|
15529
|
+
mldr: '…',
|
|
15530
|
+
nldr: '‥',
|
|
15531
|
+
boxh: '─',
|
|
15532
|
+
HorizontalLine: '─',
|
|
15533
|
+
boxv: '│',
|
|
15534
|
+
boxdr: '┌',
|
|
15535
|
+
boxdl: '┐',
|
|
15536
|
+
boxur: '└',
|
|
15537
|
+
boxul: '┘',
|
|
15538
|
+
boxvr: '├',
|
|
15539
|
+
boxvl: '┤',
|
|
15540
|
+
boxhd: '┬',
|
|
15541
|
+
boxhu: '┴',
|
|
15542
|
+
boxvh: '┼',
|
|
15543
|
+
boxH: '═',
|
|
15544
|
+
boxV: '║',
|
|
15545
|
+
boxdR: '╒',
|
|
15546
|
+
boxDr: '╓',
|
|
15547
|
+
boxDR: '╔',
|
|
15548
|
+
boxDl: '╕',
|
|
15549
|
+
boxdL: '╖',
|
|
15550
|
+
boxDL: '╗',
|
|
15551
|
+
boxuR: '╘',
|
|
15552
|
+
boxUr: '╙',
|
|
15553
|
+
boxUR: '╚',
|
|
15554
|
+
boxUl: '╜',
|
|
15555
|
+
boxuL: '╛',
|
|
15556
|
+
boxUL: '╝',
|
|
15557
|
+
boxvR: '╞',
|
|
15558
|
+
boxVr: '╟',
|
|
15559
|
+
boxVR: '╠',
|
|
15560
|
+
boxVl: '╢',
|
|
15561
|
+
boxvL: '╡',
|
|
15562
|
+
boxVL: '╣',
|
|
15563
|
+
boxHd: '╤',
|
|
15564
|
+
boxhD: '╥',
|
|
15565
|
+
boxHD: '╦',
|
|
15566
|
+
boxHu: '╧',
|
|
15567
|
+
boxhU: '╨',
|
|
15568
|
+
boxHU: '╩',
|
|
15569
|
+
boxvH: '╪',
|
|
15570
|
+
boxVh: '╫',
|
|
15571
|
+
boxVH: '╬'
|
|
15572
|
+
};
|
|
15573
|
+
const PUNCTUATION = {
|
|
15574
|
+
excl: '!',
|
|
15575
|
+
iexcl: '¡',
|
|
15576
|
+
brvbar: '¦',
|
|
15577
|
+
sect: '§',
|
|
15578
|
+
uml: '¨',
|
|
15579
|
+
copy: '©',
|
|
15580
|
+
ordf: 'ª',
|
|
15581
|
+
laquo: '«',
|
|
15582
|
+
not: '¬',
|
|
15583
|
+
shy: '\u00ad',
|
|
15584
|
+
reg: '®',
|
|
15585
|
+
macr: '¯',
|
|
15586
|
+
deg: '°',
|
|
15587
|
+
plusmn: '±',
|
|
15588
|
+
sup2: '²',
|
|
15589
|
+
sup3: '³',
|
|
15590
|
+
acute: '´',
|
|
15591
|
+
micro: 'µ',
|
|
15592
|
+
para: '¶',
|
|
15593
|
+
middot: '·',
|
|
15594
|
+
cedil: '¸',
|
|
15595
|
+
sup1: '¹',
|
|
15596
|
+
ordm: 'º',
|
|
15597
|
+
raquo: '»',
|
|
15598
|
+
frac14: '¼',
|
|
15599
|
+
frac12: '½',
|
|
15600
|
+
frac34: '¾',
|
|
15601
|
+
iquest: '¿',
|
|
15602
|
+
nbsp: '\u00a0',
|
|
15603
|
+
comma: ',',
|
|
15604
|
+
period: '.',
|
|
15605
|
+
colon: ':',
|
|
15606
|
+
semi: ';',
|
|
15607
|
+
vert: '|',
|
|
15608
|
+
Verbar: '‖',
|
|
15609
|
+
verbar: '|',
|
|
15610
|
+
dblac: '˝',
|
|
15611
|
+
circ: 'ˆ',
|
|
15612
|
+
caron: 'ˇ',
|
|
15613
|
+
breve: '˘',
|
|
15614
|
+
dot: '˙',
|
|
15615
|
+
ring: '˚',
|
|
15616
|
+
ogon: '˛',
|
|
15617
|
+
tilde: '˜',
|
|
15618
|
+
DiacriticalGrave: '`',
|
|
15619
|
+
DiacriticalAcute: '´',
|
|
15620
|
+
DiacriticalTilde: '˜',
|
|
15621
|
+
DiacriticalDot: '˙',
|
|
15622
|
+
DiacriticalDoubleAcute: '˝',
|
|
15623
|
+
grave: '`',
|
|
15624
|
+
acute: '´'
|
|
15625
|
+
};
|
|
15626
|
+
const CURRENCY = {
|
|
15627
|
+
cent: '¢',
|
|
15628
|
+
pound: '£',
|
|
15629
|
+
curren: '¤',
|
|
15630
|
+
yen: '¥',
|
|
15631
|
+
euro: '€',
|
|
15632
|
+
dollar: '$',
|
|
15633
|
+
euro: '€',
|
|
15634
|
+
fnof: 'ƒ',
|
|
15635
|
+
inr: '₹',
|
|
15636
|
+
af: '؋',
|
|
15637
|
+
birr: 'ብር',
|
|
15638
|
+
peso: '₱',
|
|
15639
|
+
rub: '₽',
|
|
15640
|
+
won: '₩',
|
|
15641
|
+
yuan: '¥',
|
|
15642
|
+
cedil: '¸'
|
|
15643
|
+
};
|
|
15644
|
+
const FRACTIONS = {
|
|
15645
|
+
frac12: '½',
|
|
15646
|
+
half: '½',
|
|
15647
|
+
frac13: '⅓',
|
|
15648
|
+
frac14: '¼',
|
|
15649
|
+
frac15: '⅕',
|
|
15650
|
+
frac16: '⅙',
|
|
15651
|
+
frac18: '⅛',
|
|
15652
|
+
frac23: '⅔',
|
|
15653
|
+
frac25: '⅖',
|
|
15654
|
+
frac34: '¾',
|
|
15655
|
+
frac35: '⅗',
|
|
15656
|
+
frac38: '⅜',
|
|
15657
|
+
frac45: '⅘',
|
|
15658
|
+
frac56: '⅚',
|
|
15659
|
+
frac58: '⅝',
|
|
15660
|
+
frac78: '⅞',
|
|
15661
|
+
frasl: '⁄'
|
|
15662
|
+
};
|
|
15663
|
+
const MISC_SYMBOLS = {
|
|
15664
|
+
trade: '™',
|
|
15665
|
+
TRADE: '™',
|
|
15666
|
+
telrec: '⌕',
|
|
15667
|
+
target: '⌖',
|
|
15668
|
+
ulcorn: '⌜',
|
|
15669
|
+
ulcorner: '⌜',
|
|
15670
|
+
urcorn: '⌝',
|
|
15671
|
+
urcorner: '⌝',
|
|
15672
|
+
dlcorn: '⌞',
|
|
15673
|
+
llcorner: '⌞',
|
|
15674
|
+
drcorn: '⌟',
|
|
15675
|
+
lrcorner: '⌟',
|
|
15676
|
+
intercal: '⊺',
|
|
15677
|
+
intcal: '⊺',
|
|
15678
|
+
oplus: '⊕',
|
|
15679
|
+
CirclePlus: '⊕',
|
|
15680
|
+
ominus: '⊖',
|
|
15681
|
+
CircleMinus: '⊖',
|
|
15682
|
+
otimes: '⊗',
|
|
15683
|
+
CircleTimes: '⊗',
|
|
15684
|
+
osol: '⊘',
|
|
15685
|
+
odot: '⊙',
|
|
15686
|
+
CircleDot: '⊙',
|
|
15687
|
+
oast: '⊛',
|
|
15688
|
+
circledast: '⊛',
|
|
15689
|
+
odash: '⊝',
|
|
15690
|
+
circleddash: '⊝',
|
|
15691
|
+
ocirc: '⊚',
|
|
15692
|
+
circledcirc: '⊚',
|
|
15693
|
+
boxplus: '⊞',
|
|
15694
|
+
plusb: '⊞',
|
|
15695
|
+
boxminus: '⊟',
|
|
15696
|
+
minusb: '⊟',
|
|
15697
|
+
boxtimes: '⊠',
|
|
15698
|
+
timesb: '⊠',
|
|
15699
|
+
boxdot: '⊡',
|
|
15700
|
+
sdotb: '⊡',
|
|
15701
|
+
veebar: '⊻',
|
|
15702
|
+
vee: '∨',
|
|
15703
|
+
barvee: '⊽',
|
|
15704
|
+
and: '∧',
|
|
15705
|
+
wedge: '∧',
|
|
15706
|
+
Cap: '⋒',
|
|
15707
|
+
Cup: '⋓',
|
|
15708
|
+
Fork: '⋔',
|
|
15709
|
+
pitchfork: '⋔',
|
|
15710
|
+
epar: '⋕',
|
|
15711
|
+
ltlarr: '⥶',
|
|
15712
|
+
nvap: '≍⃒',
|
|
15713
|
+
nvsim: '∼⃒',
|
|
15714
|
+
nvge: '≥⃒',
|
|
15715
|
+
nvle: '≤⃒',
|
|
15716
|
+
nvlt: '<⃒',
|
|
15717
|
+
nvgt: '>⃒',
|
|
15718
|
+
nvltrie: '⊴⃒',
|
|
15719
|
+
nvrtrie: '⊵⃒',
|
|
15720
|
+
Vdash: '⊩',
|
|
15721
|
+
dashv: '⊣',
|
|
15722
|
+
vDash: '⊨',
|
|
15723
|
+
Vdash: '⊩',
|
|
15724
|
+
Vvdash: '⊪',
|
|
15725
|
+
nvdash: '⊬',
|
|
15726
|
+
nvDash: '⊭',
|
|
15727
|
+
nVdash: '⊮',
|
|
15728
|
+
nVDash: '⊯'
|
|
15729
|
+
};
|
|
15730
|
+
({
|
|
15731
|
+
...BASIC_LATIN,
|
|
15732
|
+
...LATIN_ACCENTS,
|
|
15733
|
+
...LATIN_EXTENDED,
|
|
15734
|
+
...GREEK,
|
|
15735
|
+
...CYRILLIC,
|
|
15736
|
+
...MATH,
|
|
15737
|
+
...MATH_ADVANCED,
|
|
15738
|
+
...ARROWS,
|
|
15739
|
+
...SHAPES,
|
|
15740
|
+
...PUNCTUATION,
|
|
15741
|
+
...CURRENCY,
|
|
15742
|
+
...FRACTIONS,
|
|
15743
|
+
...MISC_SYMBOLS
|
|
15744
|
+
});
|
|
15745
|
+
const XML = {
|
|
15746
|
+
amp: "&",
|
|
15747
|
+
apos: "'",
|
|
15748
|
+
gt: ">",
|
|
15749
|
+
lt: "<",
|
|
15750
|
+
quot: "\""
|
|
15751
|
+
};
|
|
15752
|
+
const COMMON_HTML = {
|
|
15753
|
+
nbsp: '\u00a0',
|
|
15754
|
+
copy: '\u00a9',
|
|
15755
|
+
reg: '\u00ae',
|
|
15756
|
+
trade: '\u2122',
|
|
15757
|
+
mdash: '\u2014',
|
|
15758
|
+
ndash: '\u2013',
|
|
15759
|
+
hellip: '\u2026',
|
|
15760
|
+
laquo: '\u00ab',
|
|
15761
|
+
raquo: '\u00bb',
|
|
15762
|
+
lsquo: '\u2018',
|
|
15763
|
+
rsquo: '\u2019',
|
|
15764
|
+
ldquo: '\u201c',
|
|
15765
|
+
rdquo: '\u201d',
|
|
15766
|
+
bull: '\u2022',
|
|
15767
|
+
para: '\u00b6',
|
|
15768
|
+
sect: '\u00a7',
|
|
15769
|
+
deg: '\u00b0',
|
|
15770
|
+
frac12: '\u00bd',
|
|
15771
|
+
frac14: '\u00bc',
|
|
15772
|
+
frac34: '\u00be'
|
|
15773
|
+
};
|
|
15774
|
+
const SPECIAL_CHARS = new Set('!?\\\\/[]$%{}^&*()<>|+');
|
|
15775
|
+
function EntityDecoder_validateEntityName(name) {
|
|
15776
|
+
if ('#' === name[0]) throw new Error(`[EntityReplacer] Invalid character '#' in entity name: "${name}"`);
|
|
15777
|
+
for (const ch of name)if (SPECIAL_CHARS.has(ch)) throw new Error(`[EntityReplacer] Invalid character '${ch}' in entity name: "${name}"`);
|
|
15778
|
+
return name;
|
|
15779
|
+
}
|
|
15780
|
+
function mergeEntityMaps(...maps) {
|
|
15781
|
+
const out = Object.create(null);
|
|
15782
|
+
for (const map of maps)if (map) for (const key of Object.keys(map)){
|
|
15783
|
+
const raw = map[key];
|
|
15784
|
+
if ('string' == typeof raw) out[key] = raw;
|
|
15785
|
+
else if (raw && 'object' == typeof raw && void 0 !== raw.val) {
|
|
15786
|
+
const val = raw.val;
|
|
15787
|
+
if ('string' == typeof val) out[key] = val;
|
|
15788
|
+
}
|
|
15789
|
+
}
|
|
15790
|
+
return out;
|
|
15791
|
+
}
|
|
15792
|
+
const LIMIT_TIER_EXTERNAL = 'external';
|
|
15793
|
+
const LIMIT_TIER_BASE = 'base';
|
|
15794
|
+
const LIMIT_TIER_ALL = 'all';
|
|
15795
|
+
function parseLimitTiers(raw) {
|
|
15796
|
+
if (!raw || raw === LIMIT_TIER_EXTERNAL) return new Set([
|
|
15797
|
+
LIMIT_TIER_EXTERNAL
|
|
15798
|
+
]);
|
|
15799
|
+
if (raw === LIMIT_TIER_ALL) return new Set([
|
|
15800
|
+
LIMIT_TIER_ALL
|
|
15801
|
+
]);
|
|
15802
|
+
if (raw === LIMIT_TIER_BASE) return new Set([
|
|
15803
|
+
LIMIT_TIER_BASE
|
|
15804
|
+
]);
|
|
15805
|
+
if (Array.isArray(raw)) return new Set(raw);
|
|
15806
|
+
return new Set([
|
|
15807
|
+
LIMIT_TIER_EXTERNAL
|
|
15808
|
+
]);
|
|
15809
|
+
}
|
|
15810
|
+
const NCR_LEVEL = Object.freeze({
|
|
15811
|
+
allow: 0,
|
|
15812
|
+
leave: 1,
|
|
15813
|
+
remove: 2,
|
|
15814
|
+
throw: 3
|
|
15815
|
+
});
|
|
15816
|
+
const XML10_ALLOWED_C0 = new Set([
|
|
15817
|
+
0x09,
|
|
15818
|
+
0x0A,
|
|
15819
|
+
0x0D
|
|
15820
|
+
]);
|
|
15821
|
+
function parseNCRConfig(ncr) {
|
|
15822
|
+
if (!ncr) return {
|
|
15823
|
+
xmlVersion: 1.0,
|
|
15824
|
+
onLevel: NCR_LEVEL.allow,
|
|
15825
|
+
nullLevel: NCR_LEVEL.remove
|
|
15826
|
+
};
|
|
15827
|
+
const xmlVersion = 1.1 === ncr.xmlVersion ? 1.1 : 1.0;
|
|
15828
|
+
const onLevel = NCR_LEVEL[ncr.onNCR] ?? NCR_LEVEL.allow;
|
|
15829
|
+
const nullLevel = NCR_LEVEL[ncr.nullNCR] ?? NCR_LEVEL.remove;
|
|
15830
|
+
const clampedNull = Math.max(nullLevel, NCR_LEVEL.remove);
|
|
15831
|
+
return {
|
|
15832
|
+
xmlVersion,
|
|
15833
|
+
onLevel,
|
|
15834
|
+
nullLevel: clampedNull
|
|
15835
|
+
};
|
|
15836
|
+
}
|
|
15837
|
+
class EntityDecoder {
|
|
15838
|
+
constructor(options = {}){
|
|
15839
|
+
this._limit = options.limit || {};
|
|
15840
|
+
this._maxTotalExpansions = this._limit.maxTotalExpansions || 0;
|
|
15841
|
+
this._maxExpandedLength = this._limit.maxExpandedLength || 0;
|
|
15842
|
+
this._postCheck = 'function' == typeof options.postCheck ? options.postCheck : (r)=>r;
|
|
15843
|
+
this._limitTiers = parseLimitTiers(this._limit.applyLimitsTo ?? LIMIT_TIER_EXTERNAL);
|
|
15844
|
+
this._numericAllowed = options.numericAllowed ?? true;
|
|
15845
|
+
this._baseMap = mergeEntityMaps(XML, options.namedEntities || null);
|
|
15846
|
+
this._externalMap = Object.create(null);
|
|
15847
|
+
this._inputMap = Object.create(null);
|
|
15848
|
+
this._totalExpansions = 0;
|
|
15849
|
+
this._expandedLength = 0;
|
|
15850
|
+
this._removeSet = new Set(options.remove && Array.isArray(options.remove) ? options.remove : []);
|
|
15851
|
+
this._leaveSet = new Set(options.leave && Array.isArray(options.leave) ? options.leave : []);
|
|
15852
|
+
const ncrCfg = parseNCRConfig(options.ncr);
|
|
15853
|
+
this._ncrXmlVersion = ncrCfg.xmlVersion;
|
|
15854
|
+
this._ncrOnLevel = ncrCfg.onLevel;
|
|
15855
|
+
this._ncrNullLevel = ncrCfg.nullLevel;
|
|
15856
|
+
}
|
|
15857
|
+
setExternalEntities(map) {
|
|
15858
|
+
if (map) for (const key of Object.keys(map))EntityDecoder_validateEntityName(key);
|
|
15859
|
+
this._externalMap = mergeEntityMaps(map);
|
|
15860
|
+
}
|
|
15861
|
+
addExternalEntity(key, value) {
|
|
15862
|
+
EntityDecoder_validateEntityName(key);
|
|
15863
|
+
if ('string' == typeof value && -1 === value.indexOf('&')) this._externalMap[key] = value;
|
|
15864
|
+
}
|
|
15865
|
+
addInputEntities(map) {
|
|
15866
|
+
this._totalExpansions = 0;
|
|
15867
|
+
this._expandedLength = 0;
|
|
15868
|
+
this._inputMap = mergeEntityMaps(map);
|
|
15869
|
+
}
|
|
15870
|
+
reset() {
|
|
15871
|
+
this._inputMap = Object.create(null);
|
|
15872
|
+
this._totalExpansions = 0;
|
|
15873
|
+
this._expandedLength = 0;
|
|
15874
|
+
return this;
|
|
15875
|
+
}
|
|
15876
|
+
setXmlVersion(version) {
|
|
15877
|
+
this._ncrXmlVersion = 1.1 === version ? 1.1 : 1.0;
|
|
15878
|
+
}
|
|
15879
|
+
decode(str) {
|
|
15880
|
+
if ('string' != typeof str || 0 === str.length) return str;
|
|
15881
|
+
const original = str;
|
|
15882
|
+
const chunks = [];
|
|
15883
|
+
const len = str.length;
|
|
15884
|
+
let last = 0;
|
|
15885
|
+
let i = 0;
|
|
15886
|
+
const limitExpansions = this._maxTotalExpansions > 0;
|
|
15887
|
+
const limitLength = this._maxExpandedLength > 0;
|
|
15888
|
+
const checkLimits = limitExpansions || limitLength;
|
|
15889
|
+
while(i < len){
|
|
15890
|
+
if (38 !== str.charCodeAt(i)) {
|
|
15891
|
+
i++;
|
|
15892
|
+
continue;
|
|
15893
|
+
}
|
|
15894
|
+
let j = i + 1;
|
|
15895
|
+
while(j < len && 59 !== str.charCodeAt(j) && j - i <= 32)j++;
|
|
15896
|
+
if (j >= len || 59 !== str.charCodeAt(j)) {
|
|
15897
|
+
i++;
|
|
15898
|
+
continue;
|
|
15899
|
+
}
|
|
15900
|
+
const token = str.slice(i + 1, j);
|
|
15901
|
+
if (0 === token.length) {
|
|
15902
|
+
i++;
|
|
15903
|
+
continue;
|
|
15904
|
+
}
|
|
15905
|
+
let replacement;
|
|
15906
|
+
let tier;
|
|
15907
|
+
if (this._removeSet.has(token)) {
|
|
15908
|
+
replacement = '';
|
|
15909
|
+
if (void 0 === tier) tier = LIMIT_TIER_EXTERNAL;
|
|
15910
|
+
} else if (this._leaveSet.has(token)) {
|
|
15911
|
+
i++;
|
|
15912
|
+
continue;
|
|
15913
|
+
} else if (35 === token.charCodeAt(0)) {
|
|
15914
|
+
const ncrResult = this._resolveNCR(token);
|
|
15915
|
+
if (void 0 === ncrResult) {
|
|
15916
|
+
i++;
|
|
15917
|
+
continue;
|
|
15918
|
+
}
|
|
15919
|
+
replacement = ncrResult;
|
|
15920
|
+
tier = LIMIT_TIER_BASE;
|
|
15921
|
+
} else {
|
|
15922
|
+
const resolved = this._resolveName(token);
|
|
15923
|
+
replacement = resolved?.value;
|
|
15924
|
+
tier = resolved?.tier;
|
|
15925
|
+
}
|
|
15926
|
+
if (void 0 === replacement) {
|
|
15927
|
+
i++;
|
|
15928
|
+
continue;
|
|
15929
|
+
}
|
|
15930
|
+
if (i > last) chunks.push(str.slice(last, i));
|
|
15931
|
+
chunks.push(replacement);
|
|
15932
|
+
last = j + 1;
|
|
15933
|
+
i = last;
|
|
15934
|
+
if (checkLimits && this._tierCounts(tier)) {
|
|
15935
|
+
if (limitExpansions) {
|
|
15936
|
+
this._totalExpansions++;
|
|
15937
|
+
if (this._totalExpansions > this._maxTotalExpansions) throw new Error(`[EntityReplacer] Entity expansion count limit exceeded: ${this._totalExpansions} > ${this._maxTotalExpansions}`);
|
|
15938
|
+
}
|
|
15939
|
+
if (limitLength) {
|
|
15940
|
+
const delta = replacement.length - (token.length + 2);
|
|
15941
|
+
if (delta > 0) {
|
|
15942
|
+
this._expandedLength += delta;
|
|
15943
|
+
if (this._expandedLength > this._maxExpandedLength) throw new Error(`[EntityReplacer] Expanded content length limit exceeded: ${this._expandedLength} > ${this._maxExpandedLength}`);
|
|
15944
|
+
}
|
|
15945
|
+
}
|
|
15946
|
+
}
|
|
15947
|
+
}
|
|
15948
|
+
if (last < len) chunks.push(str.slice(last));
|
|
15949
|
+
const result = 0 === chunks.length ? str : chunks.join('');
|
|
15950
|
+
return this._postCheck(result, original);
|
|
15951
|
+
}
|
|
15952
|
+
_tierCounts(tier) {
|
|
15953
|
+
if (this._limitTiers.has(LIMIT_TIER_ALL)) return true;
|
|
15954
|
+
return this._limitTiers.has(tier);
|
|
15955
|
+
}
|
|
15956
|
+
_resolveName(name) {
|
|
15957
|
+
if (name in this._inputMap) return {
|
|
15958
|
+
value: this._inputMap[name],
|
|
15959
|
+
tier: LIMIT_TIER_EXTERNAL
|
|
15960
|
+
};
|
|
15961
|
+
if (name in this._externalMap) return {
|
|
15962
|
+
value: this._externalMap[name],
|
|
15963
|
+
tier: LIMIT_TIER_EXTERNAL
|
|
15964
|
+
};
|
|
15965
|
+
if (name in this._baseMap) return {
|
|
15966
|
+
value: this._baseMap[name],
|
|
15967
|
+
tier: LIMIT_TIER_BASE
|
|
15968
|
+
};
|
|
15969
|
+
}
|
|
15970
|
+
_classifyNCR(cp) {
|
|
15971
|
+
if (0 === cp) return this._ncrNullLevel;
|
|
15972
|
+
if (cp >= 0xD800 && cp <= 0xDFFF) return NCR_LEVEL.remove;
|
|
15973
|
+
if (1.0 === this._ncrXmlVersion) {
|
|
15974
|
+
if (cp >= 0x01 && cp <= 0x1F && !XML10_ALLOWED_C0.has(cp)) return NCR_LEVEL.remove;
|
|
15975
|
+
}
|
|
15976
|
+
return -1;
|
|
15977
|
+
}
|
|
15978
|
+
_applyNCRAction(action, token, cp) {
|
|
15979
|
+
switch(action){
|
|
15980
|
+
case NCR_LEVEL.allow:
|
|
15981
|
+
return String.fromCodePoint(cp);
|
|
15982
|
+
case NCR_LEVEL.remove:
|
|
15983
|
+
return '';
|
|
15984
|
+
case NCR_LEVEL.leave:
|
|
15985
|
+
return;
|
|
15986
|
+
case NCR_LEVEL.throw:
|
|
15987
|
+
throw new Error(`[EntityDecoder] Prohibited numeric character reference &${token}; (U+${cp.toString(16).toUpperCase().padStart(4, '0')})`);
|
|
15988
|
+
default:
|
|
15989
|
+
return String.fromCodePoint(cp);
|
|
15990
|
+
}
|
|
15991
|
+
}
|
|
15992
|
+
_resolveNCR(token) {
|
|
15993
|
+
const second = token.charCodeAt(1);
|
|
15994
|
+
let cp;
|
|
15995
|
+
cp = 120 === second || 88 === second ? parseInt(token.slice(2), 16) : parseInt(token.slice(1), 10);
|
|
15996
|
+
if (Number.isNaN(cp) || cp < 0 || cp > 0x10FFFF) return;
|
|
15997
|
+
const minimum = this._classifyNCR(cp);
|
|
15998
|
+
if (!this._numericAllowed && minimum < NCR_LEVEL.remove) return;
|
|
15999
|
+
const effective = -1 === minimum ? this._ncrOnLevel : Math.max(this._ncrOnLevel, minimum);
|
|
16000
|
+
return this._applyNCRAction(effective, token, cp);
|
|
16001
|
+
}
|
|
16002
|
+
}
|
|
14645
16003
|
function extractRawAttributes(prefixedAttrs, options) {
|
|
14646
16004
|
if (!prefixedAttrs) return {};
|
|
14647
16005
|
const attrs = options.attributesGroupName ? prefixedAttrs[options.attributesGroupName] : prefixedAttrs;
|
|
@@ -14662,76 +16020,10 @@ and limitations under the License.
|
|
|
14662
16020
|
}
|
|
14663
16021
|
}
|
|
14664
16022
|
class OrderedObjParser {
|
|
14665
|
-
constructor(options){
|
|
16023
|
+
constructor(options, externalEntities){
|
|
14666
16024
|
this.options = options;
|
|
14667
16025
|
this.currentNode = null;
|
|
14668
16026
|
this.tagsNodeStack = [];
|
|
14669
|
-
this.docTypeEntities = {};
|
|
14670
|
-
this.lastEntities = {
|
|
14671
|
-
apos: {
|
|
14672
|
-
regex: /&(apos|#39|#x27);/g,
|
|
14673
|
-
val: "'"
|
|
14674
|
-
},
|
|
14675
|
-
gt: {
|
|
14676
|
-
regex: /&(gt|#62|#x3E);/g,
|
|
14677
|
-
val: ">"
|
|
14678
|
-
},
|
|
14679
|
-
lt: {
|
|
14680
|
-
regex: /&(lt|#60|#x3C);/g,
|
|
14681
|
-
val: "<"
|
|
14682
|
-
},
|
|
14683
|
-
quot: {
|
|
14684
|
-
regex: /&(quot|#34|#x22);/g,
|
|
14685
|
-
val: "\""
|
|
14686
|
-
}
|
|
14687
|
-
};
|
|
14688
|
-
this.ampEntity = {
|
|
14689
|
-
regex: /&(amp|#38|#x26);/g,
|
|
14690
|
-
val: "&"
|
|
14691
|
-
};
|
|
14692
|
-
this.htmlEntities = {
|
|
14693
|
-
space: {
|
|
14694
|
-
regex: /&(nbsp|#160);/g,
|
|
14695
|
-
val: " "
|
|
14696
|
-
},
|
|
14697
|
-
cent: {
|
|
14698
|
-
regex: /&(cent|#162);/g,
|
|
14699
|
-
val: "¢"
|
|
14700
|
-
},
|
|
14701
|
-
pound: {
|
|
14702
|
-
regex: /&(pound|#163);/g,
|
|
14703
|
-
val: "£"
|
|
14704
|
-
},
|
|
14705
|
-
yen: {
|
|
14706
|
-
regex: /&(yen|#165);/g,
|
|
14707
|
-
val: "¥"
|
|
14708
|
-
},
|
|
14709
|
-
euro: {
|
|
14710
|
-
regex: /&(euro|#8364);/g,
|
|
14711
|
-
val: "€"
|
|
14712
|
-
},
|
|
14713
|
-
copyright: {
|
|
14714
|
-
regex: /&(copy|#169);/g,
|
|
14715
|
-
val: "©"
|
|
14716
|
-
},
|
|
14717
|
-
reg: {
|
|
14718
|
-
regex: /&(reg|#174);/g,
|
|
14719
|
-
val: "®"
|
|
14720
|
-
},
|
|
14721
|
-
inr: {
|
|
14722
|
-
regex: /&(inr|#8377);/g,
|
|
14723
|
-
val: "₹"
|
|
14724
|
-
},
|
|
14725
|
-
num_dec: {
|
|
14726
|
-
regex: /&#([0-9]{1,7});/g,
|
|
14727
|
-
val: (_, str)=>fromCodePoint(str, 10, "&#")
|
|
14728
|
-
},
|
|
14729
|
-
num_hex: {
|
|
14730
|
-
regex: /&#x([0-9a-fA-F]{1,6});/g,
|
|
14731
|
-
val: (_, str)=>fromCodePoint(str, 16, "&#x")
|
|
14732
|
-
}
|
|
14733
|
-
};
|
|
14734
|
-
this.addExternalEntities = addExternalEntities;
|
|
14735
16027
|
this.parseXml = parseXml;
|
|
14736
16028
|
this.parseTextData = parseTextData;
|
|
14737
16029
|
this.resolveNameSpace = resolveNameSpace;
|
|
@@ -14744,6 +16036,29 @@ and limitations under the License.
|
|
|
14744
16036
|
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes);
|
|
14745
16037
|
this.entityExpansionCount = 0;
|
|
14746
16038
|
this.currentExpandedLength = 0;
|
|
16039
|
+
let namedEntities = {
|
|
16040
|
+
...XML
|
|
16041
|
+
};
|
|
16042
|
+
if (this.options.entityDecoder) this.entityDecoder = this.options.entityDecoder;
|
|
16043
|
+
else {
|
|
16044
|
+
if ("object" == typeof this.options.htmlEntities) namedEntities = this.options.htmlEntities;
|
|
16045
|
+
else if (true === this.options.htmlEntities) namedEntities = {
|
|
16046
|
+
...COMMON_HTML,
|
|
16047
|
+
...CURRENCY
|
|
16048
|
+
};
|
|
16049
|
+
this.entityDecoder = new EntityDecoder({
|
|
16050
|
+
namedEntities: {
|
|
16051
|
+
...namedEntities,
|
|
16052
|
+
...externalEntities
|
|
16053
|
+
},
|
|
16054
|
+
numericAllowed: this.options.htmlEntities,
|
|
16055
|
+
limit: {
|
|
16056
|
+
maxTotalExpansions: this.options.processEntities.maxTotalExpansions,
|
|
16057
|
+
maxExpandedLength: this.options.processEntities.maxExpandedLength,
|
|
16058
|
+
applyLimitsTo: this.options.processEntities.appliesTo
|
|
16059
|
+
}
|
|
16060
|
+
});
|
|
16061
|
+
}
|
|
14747
16062
|
this.matcher = new Matcher();
|
|
14748
16063
|
this.readonlyMatcher = this.matcher.readOnly();
|
|
14749
16064
|
this.isCurrentNodeStopNode = false;
|
|
@@ -14759,17 +16074,6 @@ and limitations under the License.
|
|
|
14759
16074
|
}
|
|
14760
16075
|
}
|
|
14761
16076
|
}
|
|
14762
|
-
function addExternalEntities(externalEntities) {
|
|
14763
|
-
const entKeys = Object.keys(externalEntities);
|
|
14764
|
-
for(let i = 0; i < entKeys.length; i++){
|
|
14765
|
-
const ent = entKeys[i];
|
|
14766
|
-
const escaped = ent.replace(/[.\-+*:]/g, '\\.');
|
|
14767
|
-
this.lastEntities[ent] = {
|
|
14768
|
-
regex: new RegExp("&" + escaped + ";", "g"),
|
|
14769
|
-
val: externalEntities[ent]
|
|
14770
|
-
};
|
|
14771
|
-
}
|
|
14772
|
-
}
|
|
14773
16077
|
function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
|
|
14774
16078
|
const options = this.options;
|
|
14775
16079
|
if (void 0 !== val) {
|
|
@@ -14799,9 +16103,9 @@ and limitations under the License.
|
|
|
14799
16103
|
return tagname;
|
|
14800
16104
|
}
|
|
14801
16105
|
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
|
|
14802
|
-
function buildAttributesMap(attrStr, jPath, tagName) {
|
|
16106
|
+
function buildAttributesMap(attrStr, jPath, tagName, force = false) {
|
|
14803
16107
|
const options = this.options;
|
|
14804
|
-
if (true !== options.ignoreAttributes && 'string' == typeof attrStr) {
|
|
16108
|
+
if (true === force || true !== options.ignoreAttributes && 'string' == typeof attrStr) {
|
|
14805
16109
|
const matches = getAllMatches(attrStr, attrsRegx);
|
|
14806
16110
|
const len = matches.length;
|
|
14807
16111
|
const attrs = {};
|
|
@@ -14844,7 +16148,7 @@ and limitations under the License.
|
|
|
14844
16148
|
}
|
|
14845
16149
|
}
|
|
14846
16150
|
if (!hasAttrs) return;
|
|
14847
|
-
if (options.attributesGroupName) {
|
|
16151
|
+
if (options.attributesGroupName && !options.preserveOrder) {
|
|
14848
16152
|
const attrCollection = {};
|
|
14849
16153
|
attrCollection[options.attributesGroupName] = attrs;
|
|
14850
16154
|
return attrCollection;
|
|
@@ -14858,11 +16162,9 @@ and limitations under the License.
|
|
|
14858
16162
|
let currentNode = xmlObj;
|
|
14859
16163
|
let textData = "";
|
|
14860
16164
|
this.matcher.reset();
|
|
16165
|
+
this.entityDecoder.reset();
|
|
14861
16166
|
this.entityExpansionCount = 0;
|
|
14862
16167
|
this.currentExpandedLength = 0;
|
|
14863
|
-
this.docTypeEntitiesKeys = [];
|
|
14864
|
-
this.lastEntitiesKeys = Object.keys(this.lastEntities);
|
|
14865
|
-
this.htmlEntitiesKeys = this.options.htmlEntities ? Object.keys(this.htmlEntities) : [];
|
|
14866
16168
|
const options = this.options;
|
|
14867
16169
|
const docTypeReader = new DocTypeReader(options.processEntities);
|
|
14868
16170
|
const xmlLen = xmlData.length;
|
|
@@ -14894,11 +16196,16 @@ and limitations under the License.
|
|
|
14894
16196
|
let tagData = readTagExp(xmlData, i, false, "?>");
|
|
14895
16197
|
if (!tagData) throw new Error("Pi Tag is not closed.");
|
|
14896
16198
|
textData = this.saveTextToParentTag(textData, currentNode, this.readonlyMatcher);
|
|
16199
|
+
const attsMap = this.buildAttributesMap(tagData.tagExp, this.matcher, tagData.tagName, true);
|
|
16200
|
+
if (attsMap) {
|
|
16201
|
+
const ver = attsMap[this.options.attributeNamePrefix + "version"];
|
|
16202
|
+
this.entityDecoder.setXmlVersion(Number(ver) || 1.0);
|
|
16203
|
+
}
|
|
14897
16204
|
if (options.ignoreDeclaration && "?xml" === tagData.tagName || options.ignorePiTags) ;
|
|
14898
16205
|
else {
|
|
14899
16206
|
const childNode = new XmlNode(tagData.tagName);
|
|
14900
16207
|
childNode.add(options.textNodeName, "");
|
|
14901
|
-
if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) childNode[":@"] =
|
|
16208
|
+
if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent && true !== options.ignoreAttributes) childNode[":@"] = attsMap;
|
|
14902
16209
|
this.addChild(currentNode, childNode, this.readonlyMatcher, i);
|
|
14903
16210
|
}
|
|
14904
16211
|
i = tagData.closeIndex + 1;
|
|
@@ -14916,8 +16223,7 @@ and limitations under the License.
|
|
|
14916
16223
|
i = endIndex;
|
|
14917
16224
|
} else if (33 === c1 && 68 === xmlData.charCodeAt(i + 2)) {
|
|
14918
16225
|
const result = docTypeReader.readDocType(xmlData, i);
|
|
14919
|
-
this.
|
|
14920
|
-
this.docTypeEntitiesKeys = Object.keys(this.docTypeEntities) || [];
|
|
16226
|
+
this.entityDecoder.addInputEntities(result.entities);
|
|
14921
16227
|
i = result.i;
|
|
14922
16228
|
} else if (33 === c1 && 91 === xmlData.charCodeAt(i + 2)) {
|
|
14923
16229
|
const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
|
|
@@ -15042,42 +16348,7 @@ and limitations under the License.
|
|
|
15042
16348
|
const jPathOrMatcher = this.options.jPath ? jPath.toString() : jPath;
|
|
15043
16349
|
if (!entityConfig.tagFilter(tagName, jPathOrMatcher)) return val;
|
|
15044
16350
|
}
|
|
15045
|
-
|
|
15046
|
-
const entity = this.docTypeEntities[entityName];
|
|
15047
|
-
const matches = val.match(entity.regx);
|
|
15048
|
-
if (matches) {
|
|
15049
|
-
this.entityExpansionCount += matches.length;
|
|
15050
|
-
if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`);
|
|
15051
|
-
const lengthBefore = val.length;
|
|
15052
|
-
val = val.replace(entity.regx, entity.val);
|
|
15053
|
-
if (entityConfig.maxExpandedLength) {
|
|
15054
|
-
this.currentExpandedLength += val.length - lengthBefore;
|
|
15055
|
-
if (this.currentExpandedLength > entityConfig.maxExpandedLength) throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${entityConfig.maxExpandedLength}`);
|
|
15056
|
-
}
|
|
15057
|
-
}
|
|
15058
|
-
}
|
|
15059
|
-
if (-1 === val.indexOf('&')) return val;
|
|
15060
|
-
for (const entityName of this.lastEntitiesKeys){
|
|
15061
|
-
const entity = this.lastEntities[entityName];
|
|
15062
|
-
const matches = val.match(entity.regex);
|
|
15063
|
-
if (matches) {
|
|
15064
|
-
this.entityExpansionCount += matches.length;
|
|
15065
|
-
if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`);
|
|
15066
|
-
}
|
|
15067
|
-
val = val.replace(entity.regex, entity.val);
|
|
15068
|
-
}
|
|
15069
|
-
if (-1 === val.indexOf('&')) return val;
|
|
15070
|
-
for (const entityName of this.htmlEntitiesKeys){
|
|
15071
|
-
const entity = this.htmlEntities[entityName];
|
|
15072
|
-
const matches = val.match(entity.regex);
|
|
15073
|
-
if (matches) {
|
|
15074
|
-
this.entityExpansionCount += matches.length;
|
|
15075
|
-
if (entityConfig.maxTotalExpansions && this.entityExpansionCount > entityConfig.maxTotalExpansions) throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${entityConfig.maxTotalExpansions}`);
|
|
15076
|
-
}
|
|
15077
|
-
val = val.replace(entity.regex, entity.val);
|
|
15078
|
-
}
|
|
15079
|
-
val = val.replace(this.ampEntity.regex, this.ampEntity.val);
|
|
15080
|
-
return val;
|
|
16351
|
+
return this.entityDecoder.decode(val);
|
|
15081
16352
|
}
|
|
15082
16353
|
function saveTextToParentTag(textData, parentNode, matcher, isLeafNode) {
|
|
15083
16354
|
if (textData) {
|
|
@@ -15094,29 +16365,35 @@ and limitations under the License.
|
|
|
15094
16365
|
}
|
|
15095
16366
|
function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
|
|
15096
16367
|
let attrBoundary = 0;
|
|
15097
|
-
const chars = [];
|
|
15098
16368
|
const len = xmlData.length;
|
|
15099
16369
|
const closeCode0 = closingChar.charCodeAt(0);
|
|
15100
16370
|
const closeCode1 = closingChar.length > 1 ? closingChar.charCodeAt(1) : -1;
|
|
16371
|
+
let result = '';
|
|
16372
|
+
let segmentStart = i;
|
|
15101
16373
|
for(let index = i; index < len; index++){
|
|
15102
16374
|
const code = xmlData.charCodeAt(index);
|
|
15103
16375
|
if (attrBoundary) {
|
|
15104
16376
|
if (code === attrBoundary) attrBoundary = 0;
|
|
15105
16377
|
} else if (34 === code || 39 === code) attrBoundary = code;
|
|
15106
|
-
else if (code === closeCode0) {
|
|
15107
|
-
if (
|
|
15108
|
-
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
16378
|
+
else if (code === closeCode0) if (-1 !== closeCode1) {
|
|
16379
|
+
if (xmlData.charCodeAt(index + 1) === closeCode1) {
|
|
16380
|
+
result += xmlData.substring(segmentStart, index);
|
|
16381
|
+
return {
|
|
16382
|
+
data: result,
|
|
16383
|
+
index
|
|
16384
|
+
};
|
|
16385
|
+
}
|
|
16386
|
+
} else {
|
|
16387
|
+
result += xmlData.substring(segmentStart, index);
|
|
16388
|
+
return {
|
|
16389
|
+
data: result,
|
|
15113
16390
|
index
|
|
15114
16391
|
};
|
|
15115
|
-
} else if (9 === code) {
|
|
15116
|
-
chars.push(32);
|
|
15117
|
-
continue;
|
|
15118
16392
|
}
|
|
15119
|
-
|
|
16393
|
+
else if (9 === code && !attrBoundary) {
|
|
16394
|
+
result += xmlData.substring(segmentStart, index) + ' ';
|
|
16395
|
+
segmentStart = index + 1;
|
|
16396
|
+
}
|
|
15120
16397
|
}
|
|
15121
16398
|
}
|
|
15122
16399
|
function findClosingIndex(xmlData, str, i, errMsg) {
|
|
@@ -15184,7 +16461,7 @@ and limitations under the License.
|
|
|
15184
16461
|
const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
|
|
15185
16462
|
i = closeIndex;
|
|
15186
16463
|
} else {
|
|
15187
|
-
const tagData = readTagExp(xmlData, i,
|
|
16464
|
+
const tagData = readTagExp(xmlData, i, false);
|
|
15188
16465
|
if (tagData) {
|
|
15189
16466
|
const openTagName = tagData && tagData.tagName;
|
|
15190
16467
|
if (openTagName === tagName && "/" !== tagData.tagExp[tagData.tagExp.length - 1]) openTagCount++;
|
|
@@ -15203,11 +16480,6 @@ and limitations under the License.
|
|
|
15203
16480
|
if (isExist(val)) return val;
|
|
15204
16481
|
return '';
|
|
15205
16482
|
}
|
|
15206
|
-
function fromCodePoint(str, base, prefix) {
|
|
15207
|
-
const codePoint = Number.parseInt(str, base);
|
|
15208
|
-
if (codePoint >= 0 && codePoint <= 0x10FFFF) return String.fromCodePoint(codePoint);
|
|
15209
|
-
return prefix + str + ";";
|
|
15210
|
-
}
|
|
15211
16483
|
function transformTagName(fn, tagName, tagExp, options) {
|
|
15212
16484
|
if (fn) {
|
|
15213
16485
|
const newTagName = fn(tagName);
|
|
@@ -15255,6 +16527,7 @@ and limitations under the License.
|
|
|
15255
16527
|
else if (tagObj[property]) {
|
|
15256
16528
|
let val = node2json_compress(tagObj[property], options, matcher, readonlyMatcher);
|
|
15257
16529
|
const isLeaf = isLeafTag(val, options);
|
|
16530
|
+
if (0 === Object.keys(val).length && options.alwaysCreateTextNode) val[options.textNodeName] = "";
|
|
15258
16531
|
if (tagObj[":@"]) assignAttributes(val, tagObj[":@"], readonlyMatcher, options);
|
|
15259
16532
|
else if (1 !== Object.keys(val).length || void 0 === val[options.textNodeName] || options.alwaysCreateTextNode) {
|
|
15260
16533
|
if (0 === Object.keys(val).length) if (options.alwaysCreateTextNode) val[options.textNodeName] = "";
|
|
@@ -15546,8 +16819,7 @@ and limitations under the License.
|
|
|
15546
16819
|
const result = validator_validate(xmlData, validationOption);
|
|
15547
16820
|
if (true !== result) throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);
|
|
15548
16821
|
}
|
|
15549
|
-
const orderedObjParser = new OrderedObjParser(this.options);
|
|
15550
|
-
orderedObjParser.addExternalEntities(this.externalEntities);
|
|
16822
|
+
const orderedObjParser = new OrderedObjParser(this.options, this.externalEntities);
|
|
15551
16823
|
const orderedResult = orderedObjParser.parseXml(xmlData);
|
|
15552
16824
|
if (this.options.preserveOrder || void 0 === orderedResult) return orderedResult;
|
|
15553
16825
|
return prettify(orderedResult, this.options, orderedObjParser.matcher, orderedObjParser.readonlyMatcher);
|
|
@@ -15562,20 +16834,73 @@ and limitations under the License.
|
|
|
15562
16834
|
return XmlNode.getMetaDataSymbol();
|
|
15563
16835
|
}
|
|
15564
16836
|
}
|
|
16837
|
+
function safeComment(val) {
|
|
16838
|
+
return String(val).replace(/--/g, '- -').replace(/--/g, '- -').replace(/-$/, '- ');
|
|
16839
|
+
}
|
|
16840
|
+
function safeCdata(val) {
|
|
16841
|
+
return String(val).replace(/\]\]>/g, ']]]]><![CDATA[>');
|
|
16842
|
+
}
|
|
16843
|
+
function escapeAttribute(val) {
|
|
16844
|
+
return String(val).replace(/"/g, '"').replace(/'/g, ''');
|
|
16845
|
+
}
|
|
16846
|
+
const nameStartChar10 = ":A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�";
|
|
16847
|
+
const nameChar10 = nameStartChar10 + "\\-\\.\\d·̀-ͯ‿-⁀";
|
|
16848
|
+
const nameStartChar11 = ":A-Za-z_À-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-";
|
|
16849
|
+
const nameChar11 = nameStartChar11 + "\\-\\.\\d·̀-ͯ҇‿-⁀";
|
|
16850
|
+
const buildRegexes = (startChar, char, flags = '')=>{
|
|
16851
|
+
const ncStart = startChar.replace(':', '');
|
|
16852
|
+
const ncChar = char.replace(':', '');
|
|
16853
|
+
const ncNamePat = `[${ncStart}][${ncChar}]*`;
|
|
16854
|
+
return {
|
|
16855
|
+
name: new RegExp(`^[${startChar}][${char}]*$`, flags),
|
|
16856
|
+
ncName: new RegExp(`^${ncNamePat}$`, flags),
|
|
16857
|
+
qName: new RegExp(`^${ncNamePat}(?::${ncNamePat})?$`, flags),
|
|
16858
|
+
nmToken: new RegExp(`^[${char}]+$`, flags),
|
|
16859
|
+
nmTokens: new RegExp(`^[${char}]+(?:\\s+[${char}]+)*$`, flags)
|
|
16860
|
+
};
|
|
16861
|
+
};
|
|
16862
|
+
const regexes10 = buildRegexes(nameStartChar10, nameChar10);
|
|
16863
|
+
const regexes11 = buildRegexes(nameStartChar11, nameChar11, 'u');
|
|
16864
|
+
const getRegexes = (xmlVersion = '1.0')=>'1.1' === xmlVersion ? regexes11 : regexes10;
|
|
16865
|
+
const qName = (str, { xmlVersion = '1.0' } = {})=>getRegexes(xmlVersion).qName.test(str);
|
|
15565
16866
|
const EOL = "\n";
|
|
16867
|
+
function detectXmlVersionFromArray(jArray, options) {
|
|
16868
|
+
if (!Array.isArray(jArray) || 0 === jArray.length) return '1.0';
|
|
16869
|
+
const first = jArray[0];
|
|
16870
|
+
const firstKey = orderedJs2Xml_propName(first);
|
|
16871
|
+
if ('?xml' === firstKey) {
|
|
16872
|
+
const attrs = first[':@'];
|
|
16873
|
+
if (attrs) {
|
|
16874
|
+
const versionKey = options.attributeNamePrefix + 'version';
|
|
16875
|
+
if (attrs[versionKey]) return attrs[versionKey];
|
|
16876
|
+
}
|
|
16877
|
+
}
|
|
16878
|
+
return '1.0';
|
|
16879
|
+
}
|
|
16880
|
+
function resolveTagName(name, isAttribute, options, matcher, xmlVersion) {
|
|
16881
|
+
if (!options.sanitizeName) return name;
|
|
16882
|
+
if (qName(name, {
|
|
16883
|
+
xmlVersion
|
|
16884
|
+
})) return name;
|
|
16885
|
+
return options.sanitizeName(name, {
|
|
16886
|
+
isAttribute,
|
|
16887
|
+
matcher: matcher.readOnly()
|
|
16888
|
+
});
|
|
16889
|
+
}
|
|
15566
16890
|
function toXml(jArray, options) {
|
|
15567
16891
|
let indentation = "";
|
|
15568
|
-
if (options.format
|
|
16892
|
+
if (options.format) indentation = EOL;
|
|
15569
16893
|
const stopNodeExpressions = [];
|
|
15570
16894
|
if (options.stopNodes && Array.isArray(options.stopNodes)) for(let i = 0; i < options.stopNodes.length; i++){
|
|
15571
16895
|
const node = options.stopNodes[i];
|
|
15572
16896
|
if ('string' == typeof node) stopNodeExpressions.push(new Expression(node));
|
|
15573
16897
|
else if (node instanceof Expression) stopNodeExpressions.push(node);
|
|
15574
16898
|
}
|
|
16899
|
+
const xmlVersion = detectXmlVersionFromArray(jArray, options);
|
|
15575
16900
|
const matcher = new Matcher();
|
|
15576
|
-
return arrToStr(jArray, options, indentation, matcher, stopNodeExpressions);
|
|
16901
|
+
return arrToStr(jArray, options, indentation, matcher, stopNodeExpressions, xmlVersion);
|
|
15577
16902
|
}
|
|
15578
|
-
function arrToStr(arr, options, indentation, matcher, stopNodeExpressions) {
|
|
16903
|
+
function arrToStr(arr, options, indentation, matcher, stopNodeExpressions, xmlVersion) {
|
|
15579
16904
|
let xmlStr = "";
|
|
15580
16905
|
let isPreviousElementTag = false;
|
|
15581
16906
|
if (options.maxNestedTags && matcher.getDepth() > options.maxNestedTags) throw new Error("Maximum nested tags exceeded");
|
|
@@ -15589,13 +16914,15 @@ and limitations under the License.
|
|
|
15589
16914
|
}
|
|
15590
16915
|
for(let i = 0; i < arr.length; i++){
|
|
15591
16916
|
const tagObj = arr[i];
|
|
15592
|
-
const
|
|
15593
|
-
if (void 0 ===
|
|
16917
|
+
const rawTagName = orderedJs2Xml_propName(tagObj);
|
|
16918
|
+
if (void 0 === rawTagName) continue;
|
|
16919
|
+
const isSpecialName = rawTagName === options.textNodeName || rawTagName === options.cdataPropName || rawTagName === options.commentPropName || '?' === rawTagName[0];
|
|
16920
|
+
const tagName = isSpecialName ? rawTagName : resolveTagName(rawTagName, false, options, matcher, xmlVersion);
|
|
15594
16921
|
const attrValues = extractAttributeValues(tagObj[":@"], options);
|
|
15595
16922
|
matcher.push(tagName, attrValues);
|
|
15596
16923
|
const isStopNode = checkStopNode(matcher, stopNodeExpressions);
|
|
15597
16924
|
if (tagName === options.textNodeName) {
|
|
15598
|
-
let tagText = tagObj[
|
|
16925
|
+
let tagText = tagObj[rawTagName];
|
|
15599
16926
|
if (!isStopNode) {
|
|
15600
16927
|
tagText = options.tagValueProcessor(tagName, tagText);
|
|
15601
16928
|
tagText = orderedJs2Xml_replaceEntitiesValue(tagText, options);
|
|
@@ -15608,32 +16935,34 @@ and limitations under the License.
|
|
|
15608
16935
|
}
|
|
15609
16936
|
if (tagName === options.cdataPropName) {
|
|
15610
16937
|
if (isPreviousElementTag) xmlStr += indentation;
|
|
15611
|
-
|
|
16938
|
+
const val = tagObj[rawTagName][0][options.textNodeName];
|
|
16939
|
+
const safeVal = safeCdata(val);
|
|
16940
|
+
xmlStr += `<![CDATA[${safeVal}]]>`;
|
|
15612
16941
|
isPreviousElementTag = false;
|
|
15613
16942
|
matcher.pop();
|
|
15614
16943
|
continue;
|
|
15615
16944
|
}
|
|
15616
16945
|
if (tagName === options.commentPropName) {
|
|
15617
|
-
|
|
16946
|
+
const val = tagObj[rawTagName][0][options.textNodeName];
|
|
16947
|
+
const safeVal = safeComment(val);
|
|
16948
|
+
xmlStr += indentation + `<!--${safeVal}-->`;
|
|
15618
16949
|
isPreviousElementTag = true;
|
|
15619
16950
|
matcher.pop();
|
|
15620
16951
|
continue;
|
|
15621
16952
|
} else if ("?" === tagName[0]) {
|
|
15622
|
-
const attStr = attr_to_str(tagObj[":@"], options, isStopNode);
|
|
16953
|
+
const attStr = attr_to_str(tagObj[":@"], options, isStopNode, matcher, xmlVersion);
|
|
15623
16954
|
const tempInd = "?xml" === tagName ? "" : indentation;
|
|
15624
|
-
|
|
15625
|
-
piTextNodeName = 0 !== piTextNodeName.length ? " " + piTextNodeName : "";
|
|
15626
|
-
xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr}?>`;
|
|
16955
|
+
xmlStr += tempInd + `<${tagName}${attStr}?>`;
|
|
15627
16956
|
isPreviousElementTag = true;
|
|
15628
16957
|
matcher.pop();
|
|
15629
16958
|
continue;
|
|
15630
16959
|
}
|
|
15631
16960
|
let newIdentation = indentation;
|
|
15632
16961
|
if ("" !== newIdentation) newIdentation += options.indentBy;
|
|
15633
|
-
const attStr = attr_to_str(tagObj[":@"], options, isStopNode);
|
|
16962
|
+
const attStr = attr_to_str(tagObj[":@"], options, isStopNode, matcher, xmlVersion);
|
|
15634
16963
|
const tagStart = indentation + `<${tagName}${attStr}`;
|
|
15635
16964
|
let tagValue;
|
|
15636
|
-
tagValue = isStopNode ? getRawContent(tagObj[
|
|
16965
|
+
tagValue = isStopNode ? getRawContent(tagObj[rawTagName], options) : arrToStr(tagObj[rawTagName], options, newIdentation, matcher, stopNodeExpressions, xmlVersion);
|
|
15637
16966
|
if (-1 !== options.unpairedTags.indexOf(tagName)) if (options.suppressUnpairedNode) xmlStr += tagStart + ">";
|
|
15638
16967
|
else xmlStr += tagStart + "/>";
|
|
15639
16968
|
else if ((!tagValue || 0 === tagValue.length) && options.suppressEmptyNode) xmlStr += tagStart + "/>";
|
|
@@ -15656,7 +16985,7 @@ and limitations under the License.
|
|
|
15656
16985
|
for(let attr in attrMap){
|
|
15657
16986
|
if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue;
|
|
15658
16987
|
const cleanAttrName = attr.startsWith(options.attributeNamePrefix) ? attr.substr(options.attributeNamePrefix.length) : attr;
|
|
15659
|
-
attrValues[cleanAttrName] = attrMap[attr];
|
|
16988
|
+
attrValues[cleanAttrName] = escapeAttribute(attrMap[attr]);
|
|
15660
16989
|
hasAttrs = true;
|
|
15661
16990
|
}
|
|
15662
16991
|
return hasAttrs ? attrValues : null;
|
|
@@ -15689,7 +17018,7 @@ and limitations under the License.
|
|
|
15689
17018
|
if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue;
|
|
15690
17019
|
let attrVal = attrMap[attr];
|
|
15691
17020
|
if (true === attrVal && options.suppressBooleanAttributes) attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;
|
|
15692
|
-
else attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`;
|
|
17021
|
+
else attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${escapeAttribute(attrVal)}"`;
|
|
15693
17022
|
}
|
|
15694
17023
|
return attrStr;
|
|
15695
17024
|
}
|
|
@@ -15702,18 +17031,20 @@ and limitations under the License.
|
|
|
15702
17031
|
}
|
|
15703
17032
|
}
|
|
15704
17033
|
}
|
|
15705
|
-
function attr_to_str(attrMap, options, isStopNode) {
|
|
17034
|
+
function attr_to_str(attrMap, options, isStopNode, matcher, xmlVersion) {
|
|
15706
17035
|
let attrStr = "";
|
|
15707
17036
|
if (attrMap && !options.ignoreAttributes) for(let attr in attrMap){
|
|
15708
17037
|
if (!Object.prototype.hasOwnProperty.call(attrMap, attr)) continue;
|
|
17038
|
+
const cleanAttrName = attr.substr(options.attributeNamePrefix.length);
|
|
17039
|
+
const resolvedAttrName = isStopNode ? cleanAttrName : resolveTagName(cleanAttrName, true, options, matcher, xmlVersion);
|
|
15709
17040
|
let attrVal;
|
|
15710
17041
|
if (isStopNode) attrVal = attrMap[attr];
|
|
15711
17042
|
else {
|
|
15712
17043
|
attrVal = options.attributeValueProcessor(attr, attrMap[attr]);
|
|
15713
17044
|
attrVal = orderedJs2Xml_replaceEntitiesValue(attrVal, options);
|
|
15714
17045
|
}
|
|
15715
|
-
if (true === attrVal && options.suppressBooleanAttributes) attrStr += ` ${
|
|
15716
|
-
else attrStr += ` ${
|
|
17046
|
+
if (true === attrVal && options.suppressBooleanAttributes) attrStr += ` ${resolvedAttrName}`;
|
|
17047
|
+
else attrStr += ` ${resolvedAttrName}="${escapeAttribute(attrVal)}"`;
|
|
15717
17048
|
}
|
|
15718
17049
|
return attrStr;
|
|
15719
17050
|
}
|
|
@@ -15785,7 +17116,8 @@ and limitations under the License.
|
|
|
15785
17116
|
stopNodes: [],
|
|
15786
17117
|
oneListGroup: false,
|
|
15787
17118
|
maxNestedTags: 100,
|
|
15788
|
-
jPath: true
|
|
17119
|
+
jPath: true,
|
|
17120
|
+
sanitizeName: false
|
|
15789
17121
|
};
|
|
15790
17122
|
function Builder(options) {
|
|
15791
17123
|
this.options = Object.assign({}, fxb_defaultOptions, options);
|
|
@@ -15805,7 +17137,7 @@ and limitations under the License.
|
|
|
15805
17137
|
else {
|
|
15806
17138
|
this.ignoreAttributesFn = ignoreAttributes_getIgnoreAttributesFn(this.options.ignoreAttributes);
|
|
15807
17139
|
this.attrPrefixLen = this.options.attributeNamePrefix.length;
|
|
15808
|
-
this.isAttribute =
|
|
17140
|
+
this.isAttribute = fxb_isAttribute;
|
|
15809
17141
|
}
|
|
15810
17142
|
this.processTextOrObjNode = processTextOrObjNode;
|
|
15811
17143
|
if (this.options.format) {
|
|
@@ -15820,6 +17152,28 @@ and limitations under the License.
|
|
|
15820
17152
|
this.newLine = '';
|
|
15821
17153
|
}
|
|
15822
17154
|
}
|
|
17155
|
+
function detectXmlVersionFromObj(jObj, options) {
|
|
17156
|
+
const decl = jObj['?xml'];
|
|
17157
|
+
if (decl && 'object' == typeof decl) {
|
|
17158
|
+
if (options.attributesGroupName && decl[options.attributesGroupName]) {
|
|
17159
|
+
const v = decl[options.attributesGroupName][options.attributeNamePrefix + 'version'];
|
|
17160
|
+
if (v) return v;
|
|
17161
|
+
}
|
|
17162
|
+
const v = decl[options.attributeNamePrefix + 'version'];
|
|
17163
|
+
if (v) return v;
|
|
17164
|
+
}
|
|
17165
|
+
return '1.0';
|
|
17166
|
+
}
|
|
17167
|
+
function fxb_resolveTagName(name, isAttribute, options, matcher, xmlVersion) {
|
|
17168
|
+
if (!options.sanitizeName) return name;
|
|
17169
|
+
if (qName(name, {
|
|
17170
|
+
xmlVersion
|
|
17171
|
+
})) return name;
|
|
17172
|
+
return options.sanitizeName(name, {
|
|
17173
|
+
isAttribute,
|
|
17174
|
+
matcher: matcher.readOnly()
|
|
17175
|
+
});
|
|
17176
|
+
}
|
|
15823
17177
|
Builder.prototype.build = function(jObj) {
|
|
15824
17178
|
if (this.options.preserveOrder) return toXml(jObj, this.options);
|
|
15825
17179
|
{
|
|
@@ -15827,76 +17181,87 @@ and limitations under the License.
|
|
|
15827
17181
|
[this.options.arrayNodeName]: jObj
|
|
15828
17182
|
};
|
|
15829
17183
|
const matcher = new Matcher();
|
|
15830
|
-
|
|
17184
|
+
const xmlVersion = detectXmlVersionFromObj(jObj, this.options);
|
|
17185
|
+
return this.j2x(jObj, 0, matcher, xmlVersion).val;
|
|
15831
17186
|
}
|
|
15832
17187
|
};
|
|
15833
|
-
Builder.prototype.j2x = function(jObj, level, matcher) {
|
|
17188
|
+
Builder.prototype.j2x = function(jObj, level, matcher, xmlVersion) {
|
|
15834
17189
|
let attrStr = '';
|
|
15835
17190
|
let val = '';
|
|
15836
17191
|
if (this.options.maxNestedTags && matcher.getDepth() >= this.options.maxNestedTags) throw new Error("Maximum nested tags exceeded");
|
|
15837
17192
|
const jPath = this.options.jPath ? matcher.toString() : matcher;
|
|
15838
17193
|
const isCurrentStopNode = this.checkStopNode(matcher);
|
|
15839
|
-
for(let key in jObj)
|
|
15840
|
-
if (
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
|
|
15844
|
-
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15848
|
-
|
|
15849
|
-
else if (
|
|
15850
|
-
|
|
15851
|
-
|
|
15852
|
-
|
|
15853
|
-
|
|
15854
|
-
|
|
15855
|
-
|
|
15856
|
-
|
|
15857
|
-
|
|
15858
|
-
if ('' === textValue) val += this.indentate(level) + '<' + key + this.closeTag(key) + this.tagEndChar;
|
|
15859
|
-
else val += this.indentate(level) + '<' + key + '>' + textValue + '</' + key + this.tagEndChar;
|
|
15860
|
-
} else val += this.buildTextValNode(jObj[key], key, '', level, matcher);
|
|
15861
|
-
}
|
|
15862
|
-
} else if (Array.isArray(jObj[key])) {
|
|
15863
|
-
const arrLen = jObj[key].length;
|
|
15864
|
-
let listTagVal = "";
|
|
15865
|
-
let listTagAttr = "";
|
|
15866
|
-
for(let j = 0; j < arrLen; j++){
|
|
15867
|
-
const item = jObj[key][j];
|
|
15868
|
-
if (void 0 === item) ;
|
|
15869
|
-
else if (null === item) if ("?" === key[0]) val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;
|
|
15870
|
-
else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
|
|
15871
|
-
else if ('object' == typeof item) if (this.options.oneListGroup) {
|
|
15872
|
-
matcher.push(key);
|
|
15873
|
-
const result = this.j2x(item, level + 1, matcher);
|
|
15874
|
-
matcher.pop();
|
|
15875
|
-
listTagVal += result.val;
|
|
15876
|
-
if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) listTagAttr += result.attrStr;
|
|
15877
|
-
} else listTagVal += this.processTextOrObjNode(item, key, level, matcher);
|
|
15878
|
-
else if (this.options.oneListGroup) {
|
|
15879
|
-
let textValue = this.options.tagValueProcessor(key, item);
|
|
15880
|
-
textValue = this.replaceEntitiesValue(textValue);
|
|
15881
|
-
listTagVal += textValue;
|
|
17194
|
+
for(let key in jObj){
|
|
17195
|
+
if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue;
|
|
17196
|
+
const isSpecialKey = key === this.options.textNodeName || key === this.options.cdataPropName || key === this.options.commentPropName || this.options.attributesGroupName && key === this.options.attributesGroupName || this.isAttribute(key) || '?' === key[0];
|
|
17197
|
+
const resolvedKey = isSpecialKey ? key : fxb_resolveTagName(key, false, this.options, matcher, xmlVersion);
|
|
17198
|
+
if (void 0 === jObj[key]) {
|
|
17199
|
+
if (this.isAttribute(key)) val += '';
|
|
17200
|
+
} else if (null === jObj[key]) if (this.isAttribute(key)) val += '';
|
|
17201
|
+
else if (resolvedKey === this.options.cdataPropName || resolvedKey === this.options.commentPropName) val += '';
|
|
17202
|
+
else if ('?' === resolvedKey[0]) val += this.indentate(level) + '<' + resolvedKey + '?' + this.tagEndChar;
|
|
17203
|
+
else val += this.indentate(level) + '<' + resolvedKey + '/' + this.tagEndChar;
|
|
17204
|
+
else if (jObj[key] instanceof Date) val += this.buildTextValNode(jObj[key], resolvedKey, '', level, matcher);
|
|
17205
|
+
else if ('object' != typeof jObj[key]) {
|
|
17206
|
+
const attr = this.isAttribute(key);
|
|
17207
|
+
if (attr && !this.ignoreAttributesFn(attr, jPath)) {
|
|
17208
|
+
const resolvedAttr = fxb_resolveTagName(attr, true, this.options, matcher, xmlVersion);
|
|
17209
|
+
attrStr += this.buildAttrPairStr(resolvedAttr, '' + jObj[key], isCurrentStopNode);
|
|
17210
|
+
} else if (!attr) if (key === this.options.textNodeName) {
|
|
17211
|
+
let newval = this.options.tagValueProcessor(key, '' + jObj[key]);
|
|
17212
|
+
val += this.replaceEntitiesValue(newval);
|
|
15882
17213
|
} else {
|
|
15883
|
-
matcher.push(
|
|
17214
|
+
matcher.push(resolvedKey);
|
|
15884
17215
|
const isStopNode = this.checkStopNode(matcher);
|
|
15885
17216
|
matcher.pop();
|
|
15886
17217
|
if (isStopNode) {
|
|
15887
|
-
const textValue = '' +
|
|
15888
|
-
if ('' === textValue)
|
|
15889
|
-
else
|
|
15890
|
-
} else
|
|
15891
|
-
}
|
|
15892
|
-
}
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
17218
|
+
const textValue = '' + jObj[key];
|
|
17219
|
+
if ('' === textValue) val += this.indentate(level) + '<' + resolvedKey + this.closeTag(resolvedKey) + this.tagEndChar;
|
|
17220
|
+
else val += this.indentate(level) + '<' + resolvedKey + '>' + textValue + '</' + resolvedKey + this.tagEndChar;
|
|
17221
|
+
} else val += this.buildTextValNode(jObj[key], resolvedKey, '', level, matcher);
|
|
17222
|
+
}
|
|
17223
|
+
} else if (Array.isArray(jObj[key])) {
|
|
17224
|
+
const arrLen = jObj[key].length;
|
|
17225
|
+
let listTagVal = "";
|
|
17226
|
+
let listTagAttr = "";
|
|
17227
|
+
for(let j = 0; j < arrLen; j++){
|
|
17228
|
+
const item = jObj[key][j];
|
|
17229
|
+
if (void 0 === item) ;
|
|
17230
|
+
else if (null === item) if ("?" === resolvedKey[0]) val += this.indentate(level) + '<' + resolvedKey + '?' + this.tagEndChar;
|
|
17231
|
+
else val += this.indentate(level) + '<' + resolvedKey + '/' + this.tagEndChar;
|
|
17232
|
+
else if ('object' == typeof item) if (this.options.oneListGroup) {
|
|
17233
|
+
matcher.push(resolvedKey);
|
|
17234
|
+
const result = this.j2x(item, level + 1, matcher, xmlVersion);
|
|
17235
|
+
matcher.pop();
|
|
17236
|
+
listTagVal += result.val;
|
|
17237
|
+
if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) listTagAttr += result.attrStr;
|
|
17238
|
+
} else listTagVal += this.processTextOrObjNode(item, resolvedKey, level, matcher, xmlVersion);
|
|
17239
|
+
else if (this.options.oneListGroup) {
|
|
17240
|
+
let textValue = this.options.tagValueProcessor(resolvedKey, item);
|
|
17241
|
+
textValue = this.replaceEntitiesValue(textValue);
|
|
17242
|
+
listTagVal += textValue;
|
|
17243
|
+
} else {
|
|
17244
|
+
matcher.push(resolvedKey);
|
|
17245
|
+
const isStopNode = this.checkStopNode(matcher);
|
|
17246
|
+
matcher.pop();
|
|
17247
|
+
if (isStopNode) {
|
|
17248
|
+
const textValue = '' + item;
|
|
17249
|
+
if ('' === textValue) listTagVal += this.indentate(level) + '<' + resolvedKey + this.closeTag(resolvedKey) + this.tagEndChar;
|
|
17250
|
+
else listTagVal += this.indentate(level) + '<' + resolvedKey + '>' + textValue + '</' + resolvedKey + this.tagEndChar;
|
|
17251
|
+
} else listTagVal += this.buildTextValNode(item, resolvedKey, '', level, matcher);
|
|
17252
|
+
}
|
|
17253
|
+
}
|
|
17254
|
+
if (this.options.oneListGroup) listTagVal = this.buildObjectNode(listTagVal, resolvedKey, listTagAttr, level);
|
|
17255
|
+
val += listTagVal;
|
|
17256
|
+
} else if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
|
|
17257
|
+
const Ks = Object.keys(jObj[key]);
|
|
17258
|
+
const L = Ks.length;
|
|
17259
|
+
for(let j = 0; j < L; j++){
|
|
17260
|
+
const resolvedAttr = fxb_resolveTagName(Ks[j], true, this.options, matcher, xmlVersion);
|
|
17261
|
+
attrStr += this.buildAttrPairStr(resolvedAttr, '' + jObj[key][Ks[j]], isCurrentStopNode);
|
|
17262
|
+
}
|
|
17263
|
+
} else val += this.processTextOrObjNode(jObj[key], resolvedKey, level, matcher, xmlVersion);
|
|
17264
|
+
}
|
|
15900
17265
|
return {
|
|
15901
17266
|
attrStr: attrStr,
|
|
15902
17267
|
val: val
|
|
@@ -15908,9 +17273,9 @@ and limitations under the License.
|
|
|
15908
17273
|
val = this.replaceEntitiesValue(val);
|
|
15909
17274
|
}
|
|
15910
17275
|
if (this.options.suppressBooleanAttributes && "true" === val) return ' ' + attrName;
|
|
15911
|
-
return ' ' + attrName + '="' + val + '"';
|
|
17276
|
+
return ' ' + attrName + '="' + escapeAttribute(val) + '"';
|
|
15912
17277
|
};
|
|
15913
|
-
function processTextOrObjNode(object, key, level, matcher) {
|
|
17278
|
+
function processTextOrObjNode(object, key, level, matcher, xmlVersion) {
|
|
15914
17279
|
const attrValues = this.extractAttributes(object);
|
|
15915
17280
|
matcher.push(key, attrValues);
|
|
15916
17281
|
const isStopNode = this.checkStopNode(matcher);
|
|
@@ -15920,8 +17285,9 @@ and limitations under the License.
|
|
|
15920
17285
|
matcher.pop();
|
|
15921
17286
|
return this.buildObjectNode(rawContent, key, attrStr, level);
|
|
15922
17287
|
}
|
|
15923
|
-
const result = this.j2x(object, level + 1, matcher);
|
|
17288
|
+
const result = this.j2x(object, level + 1, matcher, xmlVersion);
|
|
15924
17289
|
matcher.pop();
|
|
17290
|
+
if ('?' === key[0]) return this.buildTextValNode('', key, result.attrStr, level, matcher);
|
|
15925
17291
|
if (void 0 !== object[this.options.textNodeName] && 1 === Object.keys(object).length) return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level, matcher);
|
|
15926
17292
|
return this.buildObjectNode(result.val, key, result.attrStr, level);
|
|
15927
17293
|
}
|
|
@@ -15934,14 +17300,14 @@ and limitations under the License.
|
|
|
15934
17300
|
for(let attrKey in attrGroup){
|
|
15935
17301
|
if (!Object.prototype.hasOwnProperty.call(attrGroup, attrKey)) continue;
|
|
15936
17302
|
const cleanKey = attrKey.startsWith(this.options.attributeNamePrefix) ? attrKey.substring(this.options.attributeNamePrefix.length) : attrKey;
|
|
15937
|
-
attrValues[cleanKey] = attrGroup[attrKey];
|
|
17303
|
+
attrValues[cleanKey] = escapeAttribute(attrGroup[attrKey]);
|
|
15938
17304
|
hasAttrs = true;
|
|
15939
17305
|
}
|
|
15940
17306
|
} else for(let key in obj){
|
|
15941
17307
|
if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;
|
|
15942
17308
|
const attr = this.isAttribute(key);
|
|
15943
17309
|
if (attr) {
|
|
15944
|
-
attrValues[attr] = obj[key];
|
|
17310
|
+
attrValues[attr] = escapeAttribute(obj[key]);
|
|
15945
17311
|
hasAttrs = true;
|
|
15946
17312
|
}
|
|
15947
17313
|
}
|
|
@@ -16002,6 +17368,7 @@ and limitations under the License.
|
|
|
16002
17368
|
if ("" === val) if ("?" === key[0]) return this.indentate(level) + '<' + key + attrStr + '?' + this.tagEndChar;
|
|
16003
17369
|
else return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar;
|
|
16004
17370
|
{
|
|
17371
|
+
if ("?" === key[0]) return this.indentate(level) + '<' + key + attrStr + '?' + this.tagEndChar;
|
|
16005
17372
|
let tagEndExp = '</' + key + this.tagEndChar;
|
|
16006
17373
|
let piClosingChar = "";
|
|
16007
17374
|
if ("?" === key[0]) {
|
|
@@ -16026,9 +17393,15 @@ and limitations under the License.
|
|
|
16026
17393
|
return false;
|
|
16027
17394
|
};
|
|
16028
17395
|
Builder.prototype.buildTextValNode = function(val, key, attrStr, level, matcher) {
|
|
16029
|
-
if (false !== this.options.cdataPropName && key === this.options.cdataPropName)
|
|
17396
|
+
if (false !== this.options.cdataPropName && key === this.options.cdataPropName) {
|
|
17397
|
+
const safeVal = safeCdata(val);
|
|
17398
|
+
return this.indentate(level) + `<![CDATA[${safeVal}]]>` + this.newLine;
|
|
17399
|
+
}
|
|
17400
|
+
if (false !== this.options.commentPropName && key === this.options.commentPropName) {
|
|
17401
|
+
const safeVal = safeComment(val);
|
|
17402
|
+
return this.indentate(level) + `<!--${safeVal}-->` + this.newLine;
|
|
17403
|
+
}
|
|
16030
17404
|
{
|
|
16031
|
-
if (false !== this.options.commentPropName && key === this.options.commentPropName) return this.indentate(level) + `<!--${val}-->` + this.newLine;
|
|
16032
17405
|
if ("?" === key[0]) return this.indentate(level) + '<' + key + attrStr + '?' + this.tagEndChar;
|
|
16033
17406
|
let textValue = this.options.tagValueProcessor(key, val);
|
|
16034
17407
|
textValue = this.replaceEntitiesValue(textValue);
|
|
@@ -16046,7 +17419,7 @@ and limitations under the License.
|
|
|
16046
17419
|
function indentate(level) {
|
|
16047
17420
|
return this.options.indentBy.repeat(level);
|
|
16048
17421
|
}
|
|
16049
|
-
function
|
|
17422
|
+
function fxb_isAttribute(name) {
|
|
16050
17423
|
if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) return name.substr(this.attrPrefixLen);
|
|
16051
17424
|
return false;
|
|
16052
17425
|
}
|
|
@@ -16476,11 +17849,18 @@ and limitations under the License.
|
|
|
16476
17849
|
if (void 0 == globalThis[symbol]) {
|
|
16477
17850
|
const te = new globalThis.TextEncoder();
|
|
16478
17851
|
const td = new globalThis.TextDecoder();
|
|
17852
|
+
let tdStrict;
|
|
16479
17853
|
globalThis[symbol] = {
|
|
16480
17854
|
encodeUtf8 (text) {
|
|
16481
17855
|
return te.encode(text);
|
|
16482
17856
|
},
|
|
16483
|
-
decodeUtf8 (bytes) {
|
|
17857
|
+
decodeUtf8 (bytes, strict) {
|
|
17858
|
+
if (strict) {
|
|
17859
|
+
if (void 0 === tdStrict) tdStrict = new globalThis.TextDecoder("utf-8", {
|
|
17860
|
+
fatal: true
|
|
17861
|
+
});
|
|
17862
|
+
return tdStrict.decode(bytes);
|
|
17863
|
+
}
|
|
16484
17864
|
return td.decode(bytes);
|
|
16485
17865
|
},
|
|
16486
17866
|
checkUtf8 (text) {
|
|
@@ -16656,8 +18036,13 @@ and limitations under the License.
|
|
|
16656
18036
|
this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
16657
18037
|
}
|
|
16658
18038
|
tag() {
|
|
16659
|
-
|
|
16660
|
-
|
|
18039
|
+
const start = this.pos;
|
|
18040
|
+
const tag = this.uint32();
|
|
18041
|
+
const bytesRead = this.pos - start;
|
|
18042
|
+
if (bytesRead > 5 || 5 == bytesRead && this.buf[this.pos - 1] > 0x0f) throw new Error("illegal tag: varint overflows uint32");
|
|
18043
|
+
const fieldNo = tag >>> 3;
|
|
18044
|
+
const wireType = 7 & tag;
|
|
18045
|
+
if (fieldNo <= 0 || wireType > 5) throw new Error("illegal tag: field no " + fieldNo + " wire type " + wireType);
|
|
16661
18046
|
return [
|
|
16662
18047
|
fieldNo,
|
|
16663
18048
|
wireType
|
|
@@ -16745,8 +18130,8 @@ and limitations under the License.
|
|
|
16745
18130
|
this.assertBounds();
|
|
16746
18131
|
return this.buf.subarray(start, start + len);
|
|
16747
18132
|
}
|
|
16748
|
-
string() {
|
|
16749
|
-
return this.decodeUtf8(this.bytes());
|
|
18133
|
+
string(strict) {
|
|
18134
|
+
return this.decodeUtf8(this.bytes(), strict);
|
|
16750
18135
|
}
|
|
16751
18136
|
}
|
|
16752
18137
|
function assertInt32(arg) {
|
|
@@ -17496,7 +18881,7 @@ and limitations under the License.
|
|
|
17496
18881
|
var _a;
|
|
17497
18882
|
switch(field.fieldKind){
|
|
17498
18883
|
case "scalar":
|
|
17499
|
-
message.set(field, readScalar(reader, field.scalar));
|
|
18884
|
+
message.set(field, readScalar(reader, field.scalar, field.utf8Validation));
|
|
17500
18885
|
break;
|
|
17501
18886
|
case "enum":
|
|
17502
18887
|
const val = readScalar(reader, descriptors_ScalarType.INT32);
|
|
@@ -17538,12 +18923,12 @@ and limitations under the License.
|
|
|
17538
18923
|
const [fieldNo] = reader.tag();
|
|
17539
18924
|
switch(fieldNo){
|
|
17540
18925
|
case 1:
|
|
17541
|
-
key = readScalar(reader, field.mapKey);
|
|
18926
|
+
key = readScalar(reader, field.mapKey, field.utf8Validation);
|
|
17542
18927
|
break;
|
|
17543
18928
|
case 2:
|
|
17544
18929
|
switch(field.mapKind){
|
|
17545
18930
|
case "scalar":
|
|
17546
|
-
val = readScalar(reader, field.scalar);
|
|
18931
|
+
val = readScalar(reader, field.scalar, field.utf8Validation);
|
|
17547
18932
|
break;
|
|
17548
18933
|
case "enum":
|
|
17549
18934
|
val = reader.int32();
|
|
@@ -17575,9 +18960,9 @@ and limitations under the License.
|
|
|
17575
18960
|
if ("message" === field.listKind) return void list.add(readMessageField(reader, options, field));
|
|
17576
18961
|
const scalarType = null != (_a = field.scalar) ? _a : descriptors_ScalarType.INT32;
|
|
17577
18962
|
const packed = wireType == binary_encoding_WireType.LengthDelimited && scalarType != descriptors_ScalarType.STRING && scalarType != descriptors_ScalarType.BYTES;
|
|
17578
|
-
if (!packed) return void list.add(readScalar(reader, scalarType));
|
|
18963
|
+
if (!packed) return void list.add(readScalar(reader, scalarType, field.utf8Validation));
|
|
17579
18964
|
const e = reader.uint32() + reader.pos;
|
|
17580
|
-
while(reader.pos < e)list.add(readScalar(reader, scalarType));
|
|
18965
|
+
while(reader.pos < e)list.add(readScalar(reader, scalarType, field.utf8Validation));
|
|
17581
18966
|
}
|
|
17582
18967
|
function readMessageField(reader, options, field, mergeMessage) {
|
|
17583
18968
|
const delimited = field.delimitedEncoding;
|
|
@@ -17585,10 +18970,10 @@ and limitations under the License.
|
|
|
17585
18970
|
readMessage(message, reader, options, delimited, delimited ? field.number : reader.uint32());
|
|
17586
18971
|
return message;
|
|
17587
18972
|
}
|
|
17588
|
-
function readScalar(reader, type) {
|
|
18973
|
+
function readScalar(reader, type, validateUtf8 = false) {
|
|
17589
18974
|
switch(type){
|
|
17590
18975
|
case descriptors_ScalarType.STRING:
|
|
17591
|
-
return reader.string();
|
|
18976
|
+
return reader.string(validateUtf8);
|
|
17592
18977
|
case descriptors_ScalarType.BOOL:
|
|
17593
18978
|
return reader.bool();
|
|
17594
18979
|
case descriptors_ScalarType.DOUBLE:
|
|
@@ -18136,6 +19521,7 @@ and limitations under the License.
|
|
|
18136
19521
|
}
|
|
18137
19522
|
const registry_EDITION_PROTO2 = 998;
|
|
18138
19523
|
const registry_EDITION_PROTO3 = 999;
|
|
19524
|
+
const EDITION_UNSTABLE = 9999;
|
|
18139
19525
|
const TYPE_STRING = 9;
|
|
18140
19526
|
const TYPE_GROUP = 10;
|
|
18141
19527
|
const TYPE_MESSAGE = 11;
|
|
@@ -18151,6 +19537,8 @@ and limitations under the License.
|
|
|
18151
19537
|
const PACKED = 1;
|
|
18152
19538
|
const DELIMITED = 2;
|
|
18153
19539
|
const OPEN = 1;
|
|
19540
|
+
const VERIFY = 2;
|
|
19541
|
+
const maximumEdition = 1001;
|
|
18154
19542
|
const featureDefaults = {
|
|
18155
19543
|
998: {
|
|
18156
19544
|
fieldPresence: 1,
|
|
@@ -18413,6 +19801,7 @@ and limitations under the License.
|
|
|
18413
19801
|
message: void 0,
|
|
18414
19802
|
enum: void 0,
|
|
18415
19803
|
presence: getFieldPresence(proto, oneof, isExtension, parentOrFile),
|
|
19804
|
+
utf8Validation: isUtf8Validated(proto, parentOrFile),
|
|
18416
19805
|
listKind: void 0,
|
|
18417
19806
|
mapKind: void 0,
|
|
18418
19807
|
mapKey: void 0,
|
|
@@ -18518,6 +19907,7 @@ and limitations under the License.
|
|
|
18518
19907
|
case "proto3":
|
|
18519
19908
|
return registry_EDITION_PROTO3;
|
|
18520
19909
|
case "editions":
|
|
19910
|
+
if (proto.edition === EDITION_UNSTABLE) return maximumEdition;
|
|
18521
19911
|
if (proto.edition in featureDefaults) return proto.edition;
|
|
18522
19912
|
throw new Error(`${proto.name}: unsupported edition`);
|
|
18523
19913
|
default:
|
|
@@ -18610,6 +20000,12 @@ and limitations under the License.
|
|
|
18610
20000
|
parent
|
|
18611
20001
|
});
|
|
18612
20002
|
}
|
|
20003
|
+
function isUtf8Validated(proto, parent) {
|
|
20004
|
+
return VERIFY == resolveFeature("utf8Validation", {
|
|
20005
|
+
proto,
|
|
20006
|
+
parent
|
|
20007
|
+
});
|
|
20008
|
+
}
|
|
18613
20009
|
function resolveFeature(name, ref) {
|
|
18614
20010
|
var _a, _b;
|
|
18615
20011
|
const featureSet = null == (_a = ref.proto.options) ? void 0 : _a.features;
|
|
@@ -19432,7 +20828,8 @@ and limitations under the License.
|
|
|
19432
20828
|
number: 10,
|
|
19433
20829
|
type: 8,
|
|
19434
20830
|
label: 1,
|
|
19435
|
-
defaultValue: "false"
|
|
20831
|
+
defaultValue: "false",
|
|
20832
|
+
options: {}
|
|
19436
20833
|
},
|
|
19437
20834
|
{
|
|
19438
20835
|
name: "java_generate_equals_and_hash",
|
|
@@ -19797,6 +21194,12 @@ and limitations under the License.
|
|
|
19797
21194
|
type: 14,
|
|
19798
21195
|
label: 1,
|
|
19799
21196
|
typeName: ".google.protobuf.Edition"
|
|
21197
|
+
},
|
|
21198
|
+
{
|
|
21199
|
+
name: "removal_error",
|
|
21200
|
+
number: 5,
|
|
21201
|
+
type: 9,
|
|
21202
|
+
label: 1
|
|
19800
21203
|
}
|
|
19801
21204
|
]
|
|
19802
21205
|
}
|
|
@@ -38576,7 +39979,7 @@ and limitations under the License.
|
|
|
38576
39979
|
PlatformVideoSource: ()=>platform_PlatformVideoSource,
|
|
38577
39980
|
PlatformVideoSources: ()=>PlatformVideoSources
|
|
38578
39981
|
});
|
|
38579
|
-
var package_namespaceObject = JSON.parse('{"UU":"@dan-uni/dan-any","rE":"1.
|
|
39982
|
+
var package_namespaceObject = JSON.parse('{"UU":"@dan-uni/dan-any","rE":"1.4.8","TB":"https://github.com/ani-uni/danuni/tree/master/packages/dan-any#readme"}');
|
|
38580
39983
|
const color_pad = (s)=>s.length < 2 ? `0${s}` : s;
|
|
38581
39984
|
const decimalToHex = (n)=>color_pad(n.toString(16));
|
|
38582
39985
|
const isDarkColor = ({ r, g, b })=>0.299 * r + 0.587 * g + 0.114 * b < 0x30;
|
|
@@ -39124,7 +40527,7 @@ and limitations under the License.
|
|
|
39124
40527
|
mode: 4,
|
|
39125
40528
|
senderID: senderID.toString(),
|
|
39126
40529
|
ctime: new Date(`${args.ctime} GMT+0800`),
|
|
39127
|
-
weight:
|
|
40530
|
+
weight: 11,
|
|
39128
40531
|
pool: 2,
|
|
39129
40532
|
attr: [
|
|
39130
40533
|
"Protect"
|
|
@@ -39132,6 +40535,9 @@ and limitations under the License.
|
|
|
39132
40535
|
platform: platform_PlatformVideoSource.Bilibili,
|
|
39133
40536
|
extra: {
|
|
39134
40537
|
bili: {
|
|
40538
|
+
dmid: args.id,
|
|
40539
|
+
attr: args.attr,
|
|
40540
|
+
mid: args.mid,
|
|
39135
40541
|
command: args
|
|
39136
40542
|
}
|
|
39137
40543
|
}
|
|
@@ -39173,10 +40579,12 @@ and limitations under the License.
|
|
|
39173
40579
|
...extra,
|
|
39174
40580
|
artplayer: {
|
|
39175
40581
|
...extra.artplayer,
|
|
40582
|
+
border: args.border,
|
|
39176
40583
|
style: args.style
|
|
39177
40584
|
}
|
|
39178
40585
|
} : {
|
|
39179
40586
|
artplayer: {
|
|
40587
|
+
border: args.border,
|
|
39180
40588
|
style: args.style
|
|
39181
40589
|
}
|
|
39182
40590
|
};
|
|
@@ -39198,6 +40606,7 @@ and limitations under the License.
|
|
|
39198
40606
|
mode,
|
|
39199
40607
|
color: this.color,
|
|
39200
40608
|
content: this.content,
|
|
40609
|
+
border: this.extra.artplayer?.border,
|
|
39201
40610
|
style: this.extra.artplayer?.style
|
|
39202
40611
|
};
|
|
39203
40612
|
}
|
|
@@ -39700,7 +41109,7 @@ and limitations under the License.
|
|
|
39700
41109
|
const rawText = JSON.stringify(raw1);
|
|
39701
41110
|
let compress;
|
|
39702
41111
|
compress = 'brotli' === compressType ? (0, index_min_lib.brotliCompressSync)(rawText) : (0, index_min_lib.gzipSync)(rawText);
|
|
39703
|
-
return `;RawCompressType: ${compressType}\n;RawBaseType: ${baseType}\n;Raw: ${'base64' === baseType ? compress.toString('base64') : fromUint16Array(lib.
|
|
41112
|
+
return `;RawCompressType: ${compressType}\n;RawBaseType: ${baseType}\n;Raw: ${'base64' === baseType ? compress.toString('base64') : fromUint16Array(lib.lF(compress))}`;
|
|
39704
41113
|
}
|
|
39705
41114
|
function deRaw(ass) {
|
|
39706
41115
|
const arr = ass.split('\n');
|
|
@@ -39714,7 +41123,7 @@ and limitations under the License.
|
|
|
39714
41123
|
if (!compressTypes.has(compressType)) compressType = 'gzip';
|
|
39715
41124
|
if (!baseTypes.has(baseType)) baseType = 'base64';
|
|
39716
41125
|
const text = lineRaw.replace(';Raw: ', '').trim();
|
|
39717
|
-
const buffer = 'base64' === baseType ? raw_Buffer.from(text, 'base64') : raw_Buffer.from(lib.
|
|
41126
|
+
const buffer = 'base64' === baseType ? raw_Buffer.from(text, 'base64') : raw_Buffer.from(lib.D4(raw_Buffer.from(text, 'utf8').toString('utf8')));
|
|
39718
41127
|
let decompress;
|
|
39719
41128
|
decompress = 'brotli' === compressType ? (0, index_min_lib.brotliDecompressSync)(buffer) : (0, index_min_lib.gunzipSync)(buffer);
|
|
39720
41129
|
try {
|
|
@@ -39865,7 +41274,7 @@ and limitations under the License.
|
|
|
39865
41274
|
function main(that) {
|
|
39866
41275
|
that.dans.forEach((d)=>{
|
|
39867
41276
|
if (d.platform !== platform_PlatformVideoSource.Bilibili) throw new Error('bili-dedupe: 仅支持B站(主站)的弹幕');
|
|
39868
|
-
if (!d.extra.bili?.dmid) throw new Error('bili-dedupe: 弹幕缺少bili extra dmid字段');
|
|
41277
|
+
if (!d.extra.bili?.dmid && !d.extra.bili?.command?.id) throw new Error('bili-dedupe: 弹幕缺少bili extra dmid字段');
|
|
39869
41278
|
});
|
|
39870
41279
|
const map = new Map();
|
|
39871
41280
|
that.dans.forEach((d)=>map.set(d.extra.bili.dmid, d));
|
|
@@ -40390,7 +41799,11 @@ and limitations under the License.
|
|
|
40390
41799
|
}
|
|
40391
41800
|
static fromBiliXML(xml, options) {
|
|
40392
41801
|
const parser = new XMLParser({
|
|
40393
|
-
ignoreAttributes: false
|
|
41802
|
+
ignoreAttributes: false,
|
|
41803
|
+
isArray: (_name, jpath, _isLeafNode, _isAttribute)=>{
|
|
41804
|
+
if ('i.d' === jpath) return true;
|
|
41805
|
+
return false;
|
|
41806
|
+
}
|
|
40394
41807
|
});
|
|
40395
41808
|
const oriData = parser.parse(xml);
|
|
40396
41809
|
const dans = oriData.i.d;
|
|
@@ -40416,6 +41829,8 @@ and limitations under the License.
|
|
|
40416
41829
|
const ok = this.dans.every((d)=>d.senderID.endsWith(`@${platform_PlatformVideoSource.Bilibili}`));
|
|
40417
41830
|
if (!ok) throw new Error('存在其他来源的senderID,请关闭该功能再试!');
|
|
40418
41831
|
}
|
|
41832
|
+
let ds = this.dans.map((dan)=>dan.toBiliXML(options));
|
|
41833
|
+
if (options?.skipBiliCommand) ds = ds.filter((d)=>null !== d);
|
|
40419
41834
|
const builder = new json2xml({
|
|
40420
41835
|
ignoreAttributes: false
|
|
40421
41836
|
});
|
|
@@ -40436,7 +41851,7 @@ and limitations under the License.
|
|
|
40436
41851
|
...DanUniConvertTipTemplate,
|
|
40437
41852
|
data: this.getShared('SOID')
|
|
40438
41853
|
},
|
|
40439
|
-
d:
|
|
41854
|
+
d: ds
|
|
40440
41855
|
}
|
|
40441
41856
|
});
|
|
40442
41857
|
}
|
|
@@ -40581,7 +41996,7 @@ and limitations under the License.
|
|
|
40581
41996
|
}, canvasCtx);
|
|
40582
41997
|
}
|
|
40583
41998
|
}
|
|
40584
|
-
var fs_extra_lib = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.
|
|
41999
|
+
var fs_extra_lib = __webpack_require__("../../node_modules/.pnpm/fs-extra@11.3.5/node_modules/fs-extra/lib/index.js");
|
|
40585
42000
|
var lib_default = /*#__PURE__*/ __webpack_require__.n(fs_extra_lib);
|
|
40586
42001
|
var Module = function(moduleArg = {}) {
|
|
40587
42002
|
var moduleRtn;
|
|
@@ -41089,55 +42504,57 @@ and limitations under the License.
|
|
|
41089
42504
|
N: 'N',
|
|
41090
42505
|
M: 'M'
|
|
41091
42506
|
}));
|
|
41092
|
-
|
|
42507
|
+
function detaolu_meta(config) {
|
|
41093
42508
|
const TRIM_ENDING = config.TRIM_ENDING;
|
|
41094
42509
|
const TRIM_SPACE = config.TRIM_SPACE;
|
|
41095
42510
|
const TRIM_WIDTH = config.TRIM_WIDTH;
|
|
41096
|
-
const FORCELIST =
|
|
42511
|
+
const FORCELIST = config.FORCELIST.map(([pattern, repl])=>[
|
|
41097
42512
|
new RegExp(pattern, 'giu'),
|
|
41098
42513
|
repl
|
|
41099
42514
|
]);
|
|
41100
42515
|
const FORCELIST_BREAK_ON_MATCH = !config.FORCELIST_CONTINUE_ON_MATCH;
|
|
41101
|
-
|
|
41102
|
-
|
|
41103
|
-
|
|
41104
|
-
|
|
41105
|
-
|
|
41106
|
-
|
|
41107
|
-
|
|
41108
|
-
|
|
41109
|
-
|
|
41110
|
-
|
|
41111
|
-
|
|
41112
|
-
|
|
41113
|
-
|
|
41114
|
-
|
|
41115
|
-
|
|
41116
|
-
|
|
41117
|
-
|
|
41118
|
-
|
|
41119
|
-
|
|
41120
|
-
|
|
41121
|
-
|
|
41122
|
-
|
|
41123
|
-
|
|
41124
|
-
|
|
41125
|
-
|
|
41126
|
-
|
|
41127
|
-
|
|
41128
|
-
|
|
41129
|
-
|
|
41130
|
-
|
|
41131
|
-
|
|
41132
|
-
|
|
42516
|
+
return (inp)=>{
|
|
42517
|
+
let len = inp.length;
|
|
42518
|
+
let text = '';
|
|
42519
|
+
if (TRIM_ENDING) {
|
|
42520
|
+
while(ENDING_CHARS.has(inp.charAt(len - 1)))len--;
|
|
42521
|
+
if (0 === len) len = inp.length;
|
|
42522
|
+
}
|
|
42523
|
+
if (TRIM_WIDTH) for(let i = 0; i < len; i++){
|
|
42524
|
+
const c = inp.charAt(i);
|
|
42525
|
+
text += WIDTH_TABLE.get(c) || c;
|
|
42526
|
+
}
|
|
42527
|
+
else text = inp.slice(0, len);
|
|
42528
|
+
if (TRIM_SPACE) text = text.replaceAll(/[ \u3000]+/g, ' ').replaceAll(/([\u3000-\u9FFF\uFF00-\uFFEF]) (?=[\u3000-\u9FFF\uFF00-\uFFEF])/g, '$1');
|
|
42529
|
+
let taolu_matched = false;
|
|
42530
|
+
for (const taolu of FORCELIST)if (taolu[0].test(text)) {
|
|
42531
|
+
text = text.replace(taolu[0], taolu[1]);
|
|
42532
|
+
taolu_matched = true;
|
|
42533
|
+
if (FORCELIST_BREAK_ON_MATCH) break;
|
|
42534
|
+
}
|
|
42535
|
+
return [
|
|
42536
|
+
taolu_matched,
|
|
42537
|
+
text
|
|
42538
|
+
];
|
|
42539
|
+
};
|
|
42540
|
+
}
|
|
42541
|
+
function whitelisted_meta(config) {
|
|
42542
|
+
const WHITELIST = config.WHITELIST.map((x)=>new RegExp(x[0], 'iu'));
|
|
42543
|
+
if (0 === WHITELIST.length) return ()=>false;
|
|
42544
|
+
return (text)=>WHITELIST.some((re)=>re.test(text));
|
|
42545
|
+
}
|
|
42546
|
+
function blacklisted_meta(config) {
|
|
42547
|
+
const BLACKLIST = config.BLACKLIST.map((x)=>x[0] ? new RegExp(x[1]) : x[1].toLowerCase());
|
|
42548
|
+
if (0 === BLACKLIST.length) return ()=>null;
|
|
42549
|
+
return (text)=>{
|
|
41133
42550
|
const lower = text.toLowerCase();
|
|
41134
42551
|
for (const pattern of BLACKLIST){
|
|
41135
42552
|
const matched = 'string' == typeof pattern ? lower.includes(pattern) : pattern.test(text);
|
|
41136
42553
|
if (matched) return 'string' == typeof pattern ? ` ${pattern}` : ` /${pattern.source}/`;
|
|
41137
42554
|
}
|
|
41138
42555
|
return null;
|
|
41139
|
-
}
|
|
41140
|
-
}
|
|
42556
|
+
};
|
|
42557
|
+
}
|
|
41141
42558
|
function extract_special_danmu(text) {
|
|
41142
42559
|
try {
|
|
41143
42560
|
text = JSON.parse(text)[4];
|
|
@@ -41153,15 +42570,25 @@ and limitations under the License.
|
|
|
41153
42570
|
const mid = Math.floor(sorted.length / 2);
|
|
41154
42571
|
return sorted[mid];
|
|
41155
42572
|
}
|
|
42573
|
+
function u8array_to_arraybuffer(array) {
|
|
42574
|
+
return array.buffer.slice(array.byteOffset, array.byteOffset + array.byteLength);
|
|
42575
|
+
}
|
|
41156
42576
|
async function load_wasm(wasm_mod) {
|
|
41157
|
-
|
|
42577
|
+
if (wasm_mod) return void await similarity_stub_init(wasm_mod);
|
|
42578
|
+
const wasm_path = new URL(__webpack_require__("./src/pakku.js/similarity-gen.wasm"), __webpack_require__.b).pathname;
|
|
42579
|
+
const wasm_u8 = await lib_default().readFile(wasm_path);
|
|
42580
|
+
await similarity_stub_init(u8array_to_arraybuffer(wasm_u8));
|
|
41158
42581
|
}
|
|
41159
42582
|
function make_ptr_idx(idx, is_next_chunk) {
|
|
41160
42583
|
return is_next_chunk ? -1 - idx : idx;
|
|
41161
42584
|
}
|
|
41162
42585
|
async function pakku_js_merge(chunk, config = DEFAULT_CONFIG) {
|
|
42586
|
+
const local_config = {
|
|
42587
|
+
...DEFAULT_CONFIG,
|
|
42588
|
+
...config
|
|
42589
|
+
};
|
|
41163
42590
|
await load_wasm();
|
|
41164
|
-
begin_chunk(
|
|
42591
|
+
begin_chunk(local_config);
|
|
41165
42592
|
const ret = {
|
|
41166
42593
|
clusters: [],
|
|
41167
42594
|
stats: new Stats(),
|
|
@@ -41226,23 +42653,26 @@ and limitations under the License.
|
|
|
41226
42653
|
});
|
|
41227
42654
|
}
|
|
41228
42655
|
}
|
|
42656
|
+
const detaolu = detaolu_meta(local_config);
|
|
42657
|
+
const whitelisted = whitelisted_meta(local_config);
|
|
42658
|
+
const blacklisted = blacklisted_meta(local_config);
|
|
41229
42659
|
function obj_to_ir(objs, s, is_next_chunk) {
|
|
41230
42660
|
return objs.map((obj, idx)=>{
|
|
41231
|
-
if (!
|
|
42661
|
+
if (!local_config.PROC_POOL1 && 1 === obj.pool) {
|
|
41232
42662
|
if (s) {
|
|
41233
42663
|
s.ignored_type++;
|
|
41234
42664
|
apply_single_cluster(idx, obj, '已忽略字幕弹幕,可以在选项中修改');
|
|
41235
42665
|
}
|
|
41236
42666
|
return null;
|
|
41237
42667
|
}
|
|
41238
|
-
if (!
|
|
42668
|
+
if (!local_config.PROC_TYPE7 && 4 === obj.mode) {
|
|
41239
42669
|
if (s) {
|
|
41240
42670
|
s.ignored_type++;
|
|
41241
42671
|
apply_single_cluster(idx, obj, '已忽略特殊弹幕,可以在选项中修改');
|
|
41242
42672
|
}
|
|
41243
42673
|
return null;
|
|
41244
42674
|
}
|
|
41245
|
-
if (!
|
|
42675
|
+
if (!local_config.PROC_TYPE4 && 1 === obj.mode) {
|
|
41246
42676
|
if (s) {
|
|
41247
42677
|
s.ignored_type++;
|
|
41248
42678
|
apply_single_cluster(idx, obj, '已忽略底部弹幕,可以在选项中修改');
|
|
@@ -41251,7 +42681,7 @@ and limitations under the License.
|
|
|
41251
42681
|
}
|
|
41252
42682
|
const disp_str = trim_dispstr(4 === obj.mode && '[' === obj.content[0] ? extract_special_danmu(obj.content) : obj.content);
|
|
41253
42683
|
if (4 !== obj.mode) {
|
|
41254
|
-
const matched = blacklisted(disp_str
|
|
42684
|
+
const matched = blacklisted(disp_str);
|
|
41255
42685
|
if (matched) {
|
|
41256
42686
|
if (s) {
|
|
41257
42687
|
s.deleted_blacklist++;
|
|
@@ -41266,17 +42696,17 @@ and limitations under the License.
|
|
|
41266
42696
|
return null;
|
|
41267
42697
|
}
|
|
41268
42698
|
}
|
|
41269
|
-
if (whitelisted(disp_str
|
|
42699
|
+
if (whitelisted(disp_str)) {
|
|
41270
42700
|
if (s) {
|
|
41271
42701
|
s.ignored_whitelist++;
|
|
41272
42702
|
apply_single_cluster(idx, obj, '命中白名单');
|
|
41273
42703
|
}
|
|
41274
42704
|
return null;
|
|
41275
42705
|
}
|
|
41276
|
-
const [matched_taolu, detaolued] = detaolu(disp_str
|
|
42706
|
+
const [matched_taolu, detaolued] = detaolu(disp_str);
|
|
41277
42707
|
if (matched_taolu) {
|
|
41278
42708
|
if (s) s.num_taolu_matched++;
|
|
41279
|
-
if (
|
|
42709
|
+
if (local_config.FORCELIST_APPLY_SINGULAR) obj = {
|
|
41280
42710
|
...obj,
|
|
41281
42711
|
content: detaolued
|
|
41282
42712
|
};
|
|
@@ -41291,7 +42721,7 @@ and limitations under the License.
|
|
|
41291
42721
|
}
|
|
41292
42722
|
const danmus = obj_to_ir(chunk.objs, ret.stats, false);
|
|
41293
42723
|
const nearby_danmus = new Queue();
|
|
41294
|
-
const THRESHOLD_MS =
|
|
42724
|
+
const THRESHOLD_MS = 1000 * local_config.THRESHOLD;
|
|
41295
42725
|
for (const dm of danmus){
|
|
41296
42726
|
while(true){
|
|
41297
42727
|
const peeked = nearby_danmus.peek();
|
|
@@ -41334,19 +42764,19 @@ and limitations under the License.
|
|
|
41334
42764
|
}
|
|
41335
42765
|
const progess = pool.dans.map((d)=>d.progress);
|
|
41336
42766
|
return UniDM.create({
|
|
41337
|
-
SOID: pool.
|
|
42767
|
+
SOID: pool.getShared('SOID') ?? pool.dans[0].SOID,
|
|
41338
42768
|
progress: dans[0].danuni_dan.progress,
|
|
41339
|
-
mode: pool.
|
|
42769
|
+
mode: pool.getShared('mode') ?? (isAllBottomMode(pool) ? dm_gen_namespaceObject.Modes.Bottom : dm_gen_namespaceObject.Modes.Top),
|
|
41340
42770
|
fontsize: dans.length > 0 ? 36 : 25,
|
|
41341
|
-
color: pool.
|
|
42771
|
+
color: pool.getShared('color') ?? pool.getMost('color').val,
|
|
41342
42772
|
senderID: 'detaolu[bot]@dan-any',
|
|
41343
42773
|
content: p.chosen_str,
|
|
41344
42774
|
weight: 10,
|
|
41345
|
-
pool: pool.
|
|
42775
|
+
pool: pool.getShared('pool') ?? pool.getMost('pool').val,
|
|
41346
42776
|
attr: [
|
|
41347
42777
|
dm_gen_namespaceObject.DMAttr.Protect
|
|
41348
42778
|
],
|
|
41349
|
-
platform: pool.
|
|
42779
|
+
platform: pool.getShared('platform') ?? pool.getMost('platform').val,
|
|
41350
42780
|
extra: {
|
|
41351
42781
|
danuni: {
|
|
41352
42782
|
merge: {
|