mol_tree2 1.0.305 → 1.0.306

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mol_tree2",
3
- "version": "1.0.305",
3
+ "version": "1.0.306",
4
4
  "exports": {
5
5
  "node": {
6
6
  "import": "./node.mjs",
package/web.test.js CHANGED
@@ -455,6 +455,8 @@ var $;
455
455
  result = compare_map(left, right);
456
456
  else if (ArrayBuffer.isView(left))
457
457
  result = compare_buffer(left, right);
458
+ else if (Symbol.iterator in left)
459
+ result = compare_iterator(left[Symbol.iterator](), right[Symbol.iterator]());
458
460
  else if (Symbol.toPrimitive in left)
459
461
  result = compare_primitive(left, right);
460
462
  else
@@ -618,7 +620,7 @@ var $;
618
620
  $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
619
621
  $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
620
622
  },
621
- 'Custom comparator'() {
623
+ 'Serializale'() {
622
624
  class User {
623
625
  name;
624
626
  rand;
@@ -633,6 +635,11 @@ var $;
633
635
  $mol_assert_ok($mol_compare_deep(new User('Jin'), new User('Jin')));
634
636
  $mol_assert_not($mol_compare_deep(new User('Jin'), new User('John')));
635
637
  },
638
+ 'Iterable'() {
639
+ $mol_assert_ok($mol_compare_deep(new URLSearchParams({ foo: 'bar' }), new URLSearchParams({ foo: 'bar' })));
640
+ $mol_assert_not($mol_compare_deep(new URLSearchParams({ foo: 'xxx' }), new URLSearchParams({ foo: 'yyy' })));
641
+ $mol_assert_not($mol_compare_deep(new URLSearchParams({ foo: 'xxx', bar: 'yyy' }), new URLSearchParams({ bar: 'yyy', foo: 'xxx' })));
642
+ },
636
643
  });
637
644
  })($ || ($ = {}));
638
645
  //mol/compare/deep/deep.test.tsx