@jest/expect-utils 28.0.2 → 28.1.3

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.
@@ -5,6 +5,9 @@ Object.defineProperty(exports, '__esModule', {
5
5
  });
6
6
  exports.equals = void 0;
7
7
  exports.isA = isA;
8
+ exports.isImmutableList = isImmutableList;
9
+ exports.isImmutableOrderedKeyed = isImmutableOrderedKeyed;
10
+ exports.isImmutableOrderedSet = isImmutableOrderedSet;
8
11
  exports.isImmutableUnorderedKeyed = isImmutableUnorderedKeyed;
9
12
  exports.isImmutableUnorderedSet = isImmutableUnorderedSet;
10
13
 
@@ -235,10 +238,11 @@ function isDomNode(obj) {
235
238
  typeof obj.nodeName === 'string' &&
236
239
  typeof obj.isEqualNode === 'function'
237
240
  );
238
- } // SENTINEL constants are from https://github.com/facebook/immutable-js
241
+ } // SENTINEL constants are from https://github.com/immutable-js/immutable-js/tree/main/src/predicates
239
242
 
240
243
  const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
241
244
  const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
245
+ const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
242
246
  const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
243
247
 
244
248
  function isImmutableUnorderedKeyed(maybeKeyed) {
@@ -256,3 +260,23 @@ function isImmutableUnorderedSet(maybeSet) {
256
260
  !maybeSet[IS_ORDERED_SENTINEL]
257
261
  );
258
262
  }
263
+
264
+ function isImmutableList(maybeList) {
265
+ return !!(maybeList && maybeList[IS_LIST_SENTINEL]);
266
+ }
267
+
268
+ function isImmutableOrderedKeyed(maybeKeyed) {
269
+ return !!(
270
+ maybeKeyed &&
271
+ maybeKeyed[IS_KEYED_SENTINEL] &&
272
+ maybeKeyed[IS_ORDERED_SENTINEL]
273
+ );
274
+ }
275
+
276
+ function isImmutableOrderedSet(maybeSet) {
277
+ return !!(
278
+ maybeSet &&
279
+ maybeSet[IS_SET_SENTINEL] &&
280
+ maybeSet[IS_ORDERED_SENTINEL]
281
+ );
282
+ }
package/build/utils.js CHANGED
@@ -278,11 +278,17 @@ const iterableEquality = (
278
278
  return false;
279
279
  }
280
280
 
281
- const aEntries = Object.entries(a);
282
- const bEntries = Object.entries(b);
281
+ if (
282
+ !(0, _jasmineUtils.isImmutableList)(a) &&
283
+ !(0, _jasmineUtils.isImmutableOrderedKeyed)(a) &&
284
+ !(0, _jasmineUtils.isImmutableOrderedSet)(a)
285
+ ) {
286
+ const aEntries = Object.entries(a);
287
+ const bEntries = Object.entries(b);
283
288
 
284
- if (!(0, _jasmineUtils.equals)(aEntries, bEntries)) {
285
- return false;
289
+ if (!(0, _jasmineUtils.equals)(aEntries, bEntries)) {
290
+ return false;
291
+ }
286
292
  } // Remove the first value from the stack of traversed values.
287
293
 
288
294
  aStack.pop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jest/expect-utils",
3
- "version": "28.0.2",
3
+ "version": "28.1.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/facebook/jest.git",
@@ -20,7 +20,8 @@
20
20
  "jest-get-type": "^28.0.2"
21
21
  },
22
22
  "devDependencies": {
23
- "jest-matcher-utils": "^28.0.2"
23
+ "immutable": "^4.0.0",
24
+ "jest-matcher-utils": "^28.1.3"
24
25
  },
25
26
  "engines": {
26
27
  "node": "^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0"
@@ -28,5 +29,5 @@
28
29
  "publishConfig": {
29
30
  "access": "public"
30
31
  },
31
- "gitHead": "279ee6658d763f024d51f340fab6a37c17d94502"
32
+ "gitHead": "2cce069800dab3fc8ca7c469b32d2e2b2f7e2bb1"
32
33
  }