mol_compare_deep 0.0.1466 → 0.0.1468
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.test.js +163 -164
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -217,133 +217,24 @@ var $;
|
|
|
217
217
|
$.$mol_fail_hidden = $mol_fail_hidden;
|
|
218
218
|
})($ || ($ = {}));
|
|
219
219
|
|
|
220
|
-
;
|
|
221
|
-
"use strict";
|
|
222
|
-
var $node = new Proxy({ require }, {
|
|
223
|
-
get(target, name, wrapper) {
|
|
224
|
-
if (target[name])
|
|
225
|
-
return target[name];
|
|
226
|
-
const $$ = $;
|
|
227
|
-
if ($$.$node_internal_check(name, target))
|
|
228
|
-
return target.require(name);
|
|
229
|
-
if (name[0] === '.')
|
|
230
|
-
return target.require(name);
|
|
231
|
-
try {
|
|
232
|
-
target.require.resolve(name);
|
|
233
|
-
}
|
|
234
|
-
catch {
|
|
235
|
-
try {
|
|
236
|
-
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
|
|
237
|
-
}
|
|
238
|
-
catch (e) {
|
|
239
|
-
if ($$.$mol_promise_like(e))
|
|
240
|
-
$$.$mol_fail_hidden(e);
|
|
241
|
-
}
|
|
242
|
-
try {
|
|
243
|
-
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
|
|
244
|
-
}
|
|
245
|
-
catch (e) {
|
|
246
|
-
if ($$.$mol_promise_like(e))
|
|
247
|
-
$$.$mol_fail_hidden(e);
|
|
248
|
-
$$.$mol_fail_log(e);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
return target.require(name);
|
|
252
|
-
},
|
|
253
|
-
set(target, name, value) {
|
|
254
|
-
target[name] = value;
|
|
255
|
-
return true;
|
|
256
|
-
},
|
|
257
|
-
});
|
|
258
|
-
const cache = new Map();
|
|
259
|
-
require = (req => Object.assign(function require(name) {
|
|
260
|
-
return $node[name];
|
|
261
|
-
}, req))(require);
|
|
262
|
-
|
|
263
|
-
;
|
|
264
|
-
"use strict";
|
|
265
|
-
var $;
|
|
266
|
-
(function ($) {
|
|
267
|
-
$.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
|
|
268
|
-
})($ || ($ = {}));
|
|
269
|
-
|
|
270
|
-
;
|
|
271
|
-
"use strict";
|
|
272
|
-
var $;
|
|
273
|
-
(function ($) {
|
|
274
|
-
$.$mol_dom = $mol_dom_context;
|
|
275
|
-
})($ || ($ = {}));
|
|
276
|
-
|
|
277
220
|
;
|
|
278
221
|
"use strict";
|
|
279
222
|
var $;
|
|
280
223
|
(function ($) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
break;
|
|
292
|
-
}
|
|
293
|
-
if (nextNode == view) {
|
|
294
|
-
nextNode = nextNode.nextSibling;
|
|
295
|
-
break;
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
if (node_set.has(nextNode)) {
|
|
299
|
-
el.insertBefore(view, nextNode);
|
|
300
|
-
break;
|
|
301
|
-
}
|
|
302
|
-
else {
|
|
303
|
-
const nn = nextNode.nextSibling;
|
|
304
|
-
el.removeChild(nextNode);
|
|
305
|
-
nextNode = nn;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
if (nextNode && nextNode.nodeName === '#text') {
|
|
312
|
-
const str = String(view);
|
|
313
|
-
if (nextNode.nodeValue !== str)
|
|
314
|
-
nextNode.nodeValue = str;
|
|
315
|
-
nextNode = nextNode.nextSibling;
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
const textNode = $mol_dom_context.document.createTextNode(String(view));
|
|
319
|
-
el.insertBefore(textNode, nextNode);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
while (nextNode) {
|
|
324
|
-
const currNode = nextNode;
|
|
325
|
-
nextNode = currNode.nextSibling;
|
|
326
|
-
el.removeChild(currNode);
|
|
327
|
-
}
|
|
224
|
+
const catched = new WeakSet();
|
|
225
|
+
function $mol_fail_catch(error) {
|
|
226
|
+
if (typeof error !== 'object')
|
|
227
|
+
return false;
|
|
228
|
+
if ($mol_promise_like(error))
|
|
229
|
+
$mol_fail_hidden(error);
|
|
230
|
+
if (catched.has(error))
|
|
231
|
+
return false;
|
|
232
|
+
catched.add(error);
|
|
233
|
+
return true;
|
|
328
234
|
}
|
|
329
|
-
$.$
|
|
235
|
+
$.$mol_fail_catch = $mol_fail_catch;
|
|
330
236
|
})($ || ($ = {}));
|
|
331
237
|
|
|
332
|
-
;
|
|
333
|
-
"use strict";
|
|
334
|
-
|
|
335
|
-
;
|
|
336
|
-
"use strict";
|
|
337
|
-
|
|
338
|
-
;
|
|
339
|
-
"use strict";
|
|
340
|
-
|
|
341
|
-
;
|
|
342
|
-
"use strict";
|
|
343
|
-
|
|
344
|
-
;
|
|
345
|
-
"use strict";
|
|
346
|
-
|
|
347
238
|
;
|
|
348
239
|
"use strict";
|
|
349
240
|
var $;
|
|
@@ -746,13 +637,92 @@ var $;
|
|
|
746
637
|
"use strict";
|
|
747
638
|
var $;
|
|
748
639
|
(function ($) {
|
|
749
|
-
function $
|
|
750
|
-
|
|
751
|
-
|
|
640
|
+
function $mol_try(handler) {
|
|
641
|
+
try {
|
|
642
|
+
return handler();
|
|
643
|
+
}
|
|
644
|
+
catch (error) {
|
|
645
|
+
return error;
|
|
646
|
+
}
|
|
752
647
|
}
|
|
753
|
-
$.$
|
|
648
|
+
$.$mol_try = $mol_try;
|
|
649
|
+
})($ || ($ = {}));
|
|
650
|
+
|
|
651
|
+
;
|
|
652
|
+
"use strict";
|
|
653
|
+
var $;
|
|
654
|
+
(function ($) {
|
|
655
|
+
$mol_test({
|
|
656
|
+
'return result without errors'() {
|
|
657
|
+
$mol_assert_equal($mol_try(() => false), false);
|
|
658
|
+
},
|
|
659
|
+
});
|
|
754
660
|
})($ || ($ = {}));
|
|
755
661
|
|
|
662
|
+
;
|
|
663
|
+
"use strict";
|
|
664
|
+
var $;
|
|
665
|
+
(function ($) {
|
|
666
|
+
function $mol_fail_log(error) {
|
|
667
|
+
if ($mol_promise_like(error))
|
|
668
|
+
return false;
|
|
669
|
+
if (!$mol_fail_catch(error))
|
|
670
|
+
return false;
|
|
671
|
+
$mol_try(() => { $mol_fail_hidden(error); });
|
|
672
|
+
return true;
|
|
673
|
+
}
|
|
674
|
+
$.$mol_fail_log = $mol_fail_log;
|
|
675
|
+
})($ || ($ = {}));
|
|
676
|
+
|
|
677
|
+
;
|
|
678
|
+
"use strict";
|
|
679
|
+
var $;
|
|
680
|
+
(function ($_1) {
|
|
681
|
+
$mol_test_mocks.push($ => $.$mol_fail_log = () => false);
|
|
682
|
+
})($ || ($ = {}));
|
|
683
|
+
|
|
684
|
+
;
|
|
685
|
+
"use strict";
|
|
686
|
+
var $node = new Proxy({ require }, {
|
|
687
|
+
get(target, name, wrapper) {
|
|
688
|
+
if (target[name])
|
|
689
|
+
return target[name];
|
|
690
|
+
const $$ = $;
|
|
691
|
+
if ($$.$node_internal_check(name, target))
|
|
692
|
+
return target.require(name);
|
|
693
|
+
if (name[0] === '.')
|
|
694
|
+
return target.require(name);
|
|
695
|
+
try {
|
|
696
|
+
target.require.resolve(name);
|
|
697
|
+
}
|
|
698
|
+
catch {
|
|
699
|
+
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
|
|
700
|
+
try {
|
|
701
|
+
$$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
|
|
702
|
+
}
|
|
703
|
+
catch (e) {
|
|
704
|
+
if ($$.$mol_promise_like(e))
|
|
705
|
+
$$.$mol_fail_hidden(e);
|
|
706
|
+
$$.$mol_fail_log(e);
|
|
707
|
+
}
|
|
708
|
+
const mam_node_modules = target.require('node:path').join(process.cwd(), 'node_modules');
|
|
709
|
+
if (!process.env.NODE_PATH?.includes(mam_node_modules)) {
|
|
710
|
+
process.env.NODE_PATH = `${mam_node_modules}${process.env.NODE_PATH ? `:${process.env.NODE_PATH}` : ''}`;
|
|
711
|
+
target.require('node:module').Module._initPaths();
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return target.require(name);
|
|
715
|
+
},
|
|
716
|
+
set(target, name, value) {
|
|
717
|
+
target[name] = value;
|
|
718
|
+
return true;
|
|
719
|
+
},
|
|
720
|
+
});
|
|
721
|
+
const cache = new Map();
|
|
722
|
+
require = (req => Object.assign(function require(name) {
|
|
723
|
+
return $node[name];
|
|
724
|
+
}, req))(require);
|
|
725
|
+
|
|
756
726
|
;
|
|
757
727
|
"use strict";
|
|
758
728
|
var $;
|
|
@@ -941,6 +911,15 @@ var $;
|
|
|
941
911
|
;
|
|
942
912
|
"use strict";
|
|
943
913
|
|
|
914
|
+
;
|
|
915
|
+
"use strict";
|
|
916
|
+
|
|
917
|
+
;
|
|
918
|
+
"use strict";
|
|
919
|
+
|
|
920
|
+
;
|
|
921
|
+
"use strict";
|
|
922
|
+
|
|
944
923
|
;
|
|
945
924
|
"use strict";
|
|
946
925
|
var $;
|
|
@@ -3316,66 +3295,86 @@ var $;
|
|
|
3316
3295
|
"use strict";
|
|
3317
3296
|
var $;
|
|
3318
3297
|
(function ($) {
|
|
3319
|
-
|
|
3320
|
-
function $mol_fail_catch(error) {
|
|
3321
|
-
if (typeof error !== 'object')
|
|
3322
|
-
return false;
|
|
3323
|
-
if ($mol_promise_like(error))
|
|
3324
|
-
$mol_fail_hidden(error);
|
|
3325
|
-
if (catched.has(error))
|
|
3326
|
-
return false;
|
|
3327
|
-
catched.add(error);
|
|
3328
|
-
return true;
|
|
3329
|
-
}
|
|
3330
|
-
$.$mol_fail_catch = $mol_fail_catch;
|
|
3298
|
+
$.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
|
|
3331
3299
|
})($ || ($ = {}));
|
|
3332
3300
|
|
|
3333
3301
|
;
|
|
3334
3302
|
"use strict";
|
|
3335
3303
|
var $;
|
|
3336
3304
|
(function ($) {
|
|
3337
|
-
|
|
3338
|
-
try {
|
|
3339
|
-
return handler();
|
|
3340
|
-
}
|
|
3341
|
-
catch (error) {
|
|
3342
|
-
return error;
|
|
3343
|
-
}
|
|
3344
|
-
}
|
|
3345
|
-
$.$mol_try = $mol_try;
|
|
3305
|
+
$.$mol_dom = $mol_dom_context;
|
|
3346
3306
|
})($ || ($ = {}));
|
|
3347
3307
|
|
|
3348
3308
|
;
|
|
3349
3309
|
"use strict";
|
|
3350
3310
|
var $;
|
|
3351
3311
|
(function ($) {
|
|
3352
|
-
$
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3312
|
+
function $mol_dom_render_children(el, childNodes) {
|
|
3313
|
+
const node_set = new Set(childNodes);
|
|
3314
|
+
let nextNode = el.firstChild;
|
|
3315
|
+
for (let view of childNodes) {
|
|
3316
|
+
if (view == null)
|
|
3317
|
+
continue;
|
|
3318
|
+
if (view instanceof $mol_dom_context.Node) {
|
|
3319
|
+
while (true) {
|
|
3320
|
+
if (!nextNode) {
|
|
3321
|
+
el.appendChild(view);
|
|
3322
|
+
break;
|
|
3323
|
+
}
|
|
3324
|
+
if (nextNode == view) {
|
|
3325
|
+
nextNode = nextNode.nextSibling;
|
|
3326
|
+
break;
|
|
3327
|
+
}
|
|
3328
|
+
else {
|
|
3329
|
+
if (node_set.has(nextNode)) {
|
|
3330
|
+
el.insertBefore(view, nextNode);
|
|
3331
|
+
break;
|
|
3332
|
+
}
|
|
3333
|
+
else {
|
|
3334
|
+
const nn = nextNode.nextSibling;
|
|
3335
|
+
el.removeChild(nextNode);
|
|
3336
|
+
nextNode = nn;
|
|
3337
|
+
}
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
else {
|
|
3342
|
+
if (nextNode && nextNode.nodeName === '#text') {
|
|
3343
|
+
const str = String(view);
|
|
3344
|
+
if (nextNode.nodeValue !== str)
|
|
3345
|
+
nextNode.nodeValue = str;
|
|
3346
|
+
nextNode = nextNode.nextSibling;
|
|
3347
|
+
}
|
|
3348
|
+
else {
|
|
3349
|
+
const textNode = $mol_dom_context.document.createTextNode(String(view));
|
|
3350
|
+
el.insertBefore(textNode, nextNode);
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
while (nextNode) {
|
|
3355
|
+
const currNode = nextNode;
|
|
3356
|
+
nextNode = currNode.nextSibling;
|
|
3357
|
+
el.removeChild(currNode);
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
$.$mol_dom_render_children = $mol_dom_render_children;
|
|
3357
3361
|
})($ || ($ = {}));
|
|
3358
3362
|
|
|
3359
3363
|
;
|
|
3360
3364
|
"use strict";
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
if ($mol_promise_like(error))
|
|
3365
|
-
return false;
|
|
3366
|
-
if (!$mol_fail_catch(error))
|
|
3367
|
-
return false;
|
|
3368
|
-
$mol_try(() => { $mol_fail_hidden(error); });
|
|
3369
|
-
return true;
|
|
3370
|
-
}
|
|
3371
|
-
$.$mol_fail_log = $mol_fail_log;
|
|
3372
|
-
})($ || ($ = {}));
|
|
3365
|
+
|
|
3366
|
+
;
|
|
3367
|
+
"use strict";
|
|
3373
3368
|
|
|
3374
3369
|
;
|
|
3375
3370
|
"use strict";
|
|
3376
3371
|
var $;
|
|
3377
|
-
(function ($
|
|
3378
|
-
$
|
|
3372
|
+
(function ($) {
|
|
3373
|
+
function $mol_dom_serialize(node) {
|
|
3374
|
+
const serializer = new $mol_dom_context.XMLSerializer;
|
|
3375
|
+
return serializer.serializeToString(node);
|
|
3376
|
+
}
|
|
3377
|
+
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
3379
3378
|
})($ || ($ = {}));
|
|
3380
3379
|
|
|
3381
3380
|
;
|