mol_tree2 1.0.305 → 1.0.307

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 CHANGED
@@ -1978,6 +1978,8 @@ var $;
1978
1978
  result = compare_map(left, right);
1979
1979
  else if (ArrayBuffer.isView(left))
1980
1980
  result = compare_buffer(left, right);
1981
+ else if (Symbol.iterator in left)
1982
+ result = compare_iterator(left[Symbol.iterator](), right[Symbol.iterator]());
1981
1983
  else if (Symbol.toPrimitive in left)
1982
1984
  result = compare_primitive(left, right);
1983
1985
  else
@@ -2141,7 +2143,7 @@ var $;
2141
2143
  $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
2142
2144
  $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
2143
2145
  },
2144
- 'Custom comparator'() {
2146
+ 'Serializale'() {
2145
2147
  class User {
2146
2148
  name;
2147
2149
  rand;
@@ -2156,6 +2158,11 @@ var $;
2156
2158
  $mol_assert_ok($mol_compare_deep(new User('Jin'), new User('Jin')));
2157
2159
  $mol_assert_not($mol_compare_deep(new User('Jin'), new User('John')));
2158
2160
  },
2161
+ 'Iterable'() {
2162
+ $mol_assert_ok($mol_compare_deep(new URLSearchParams({ foo: 'bar' }), new URLSearchParams({ foo: 'bar' })));
2163
+ $mol_assert_not($mol_compare_deep(new URLSearchParams({ foo: 'xxx' }), new URLSearchParams({ foo: 'yyy' })));
2164
+ $mol_assert_not($mol_compare_deep(new URLSearchParams({ foo: 'xxx', bar: 'yyy' }), new URLSearchParams({ bar: 'yyy', foo: 'xxx' })));
2165
+ },
2159
2166
  });
2160
2167
  })($ || ($ = {}));
2161
2168
  //mol/compare/deep/deep.test.tsx