mol_dump_lib 0.0.943 → 0.0.944
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/node.d.ts +4 -0
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +27 -1
- package/node.js.map +1 -1
- package/node.mjs +27 -1
- package/node.test.js +51 -2
- package/node.test.js.map +1 -1
- package/package.json +3 -1
package/node.js
CHANGED
|
@@ -1739,6 +1739,30 @@ var $;
|
|
|
1739
1739
|
$.$mol_tree2_from_string = $mol_tree2_from_string;
|
|
1740
1740
|
})($ || ($ = {}));
|
|
1741
1741
|
|
|
1742
|
+
;
|
|
1743
|
+
"use strict";
|
|
1744
|
+
var $;
|
|
1745
|
+
(function ($) {
|
|
1746
|
+
function $mol_array_chunks(array, rule) {
|
|
1747
|
+
const br = typeof rule === 'number' ? (_, i) => i % rule === 0 : rule;
|
|
1748
|
+
let chunk = [];
|
|
1749
|
+
const chunks = [];
|
|
1750
|
+
for (let i = 0; i < array.length; ++i) {
|
|
1751
|
+
const item = array[i];
|
|
1752
|
+
if (br(item, i)) {
|
|
1753
|
+
if (chunk.length)
|
|
1754
|
+
chunks.push(chunk);
|
|
1755
|
+
chunk = [];
|
|
1756
|
+
}
|
|
1757
|
+
chunk.push(item);
|
|
1758
|
+
}
|
|
1759
|
+
if (chunk.length)
|
|
1760
|
+
chunks.push(chunk);
|
|
1761
|
+
return chunks;
|
|
1762
|
+
}
|
|
1763
|
+
$.$mol_array_chunks = $mol_array_chunks;
|
|
1764
|
+
})($ || ($ = {}));
|
|
1765
|
+
|
|
1742
1766
|
;
|
|
1743
1767
|
"use strict";
|
|
1744
1768
|
var $;
|
|
@@ -1759,7 +1783,9 @@ var $;
|
|
|
1759
1783
|
}
|
|
1760
1784
|
if (ArrayBuffer.isView(json)) {
|
|
1761
1785
|
const buf = new Uint8Array(json.buffer, json.byteOffset, json.byteLength);
|
|
1762
|
-
|
|
1786
|
+
const codes = [...buf].map(b => b.toString(16).toUpperCase().padStart(2, '0'));
|
|
1787
|
+
const str = $mol_array_chunks(codes, 8).map(c => c.join(' ')).join('\n');
|
|
1788
|
+
return $mol_tree2.data(str, [], span);
|
|
1763
1789
|
}
|
|
1764
1790
|
if (json instanceof Date) {
|
|
1765
1791
|
return new $mol_tree2('', json.toISOString(), [], span);
|