@sinonjs/samsam
Advanced tools
Comparing version 3.3.1 to 3.3.2
@@ -134,2 +134,8 @@ (function (global, factory) { | ||
function isMap(value) { | ||
return typeof Map !== "undefined" && value instanceof Map; | ||
} | ||
var isMap_1 = isMap; | ||
// Returns true when the value is a regular Object and not a specialized Object | ||
@@ -209,2 +215,3 @@ // | ||
var every = Array.prototype.every; | ||
@@ -349,2 +356,21 @@ var getTime = Date.prototype.getTime; | ||
if (isMap_1(actualObj) || isMap_1(expectationObj)) { | ||
if ( | ||
!isMap_1(actualObj) || | ||
!isMap_1(expectationObj) || | ||
actualObj.size !== expectationObj.size | ||
) { | ||
return false; | ||
} | ||
var mapsDeeplyEqual = true; | ||
actualObj.forEach(function(value, key) { | ||
mapsDeeplyEqual = | ||
mapsDeeplyEqual && | ||
deepEqualCyclic(value, expectationObj.get(key)); | ||
}); | ||
return mapsDeeplyEqual; | ||
} | ||
return every.call(expectationKeysAndSymbols, function(key) { | ||
@@ -351,0 +377,0 @@ if (!hasOwnProperty.call(actualObj, key)) { |
@@ -10,2 +10,3 @@ "use strict"; | ||
var isElement = require("./is-element"); | ||
var isMap = require("./is-map"); | ||
var isNaN = require("./is-nan"); | ||
@@ -156,2 +157,21 @@ var isObject = require("./is-object"); | ||
if (isMap(actualObj) || isMap(expectationObj)) { | ||
if ( | ||
!isMap(actualObj) || | ||
!isMap(expectationObj) || | ||
actualObj.size !== expectationObj.size | ||
) { | ||
return false; | ||
} | ||
var mapsDeeplyEqual = true; | ||
actualObj.forEach(function(value, key) { | ||
mapsDeeplyEqual = | ||
mapsDeeplyEqual && | ||
deepEqualCyclic(value, expectationObj.get(key)); | ||
}); | ||
return mapsDeeplyEqual; | ||
} | ||
return every.call(expectationKeysAndSymbols, function(key) { | ||
@@ -158,0 +178,0 @@ if (!hasOwnProperty.call(actualObj, key)) { |
{ | ||
"name": "@sinonjs/samsam", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": "Value identification and comparison functions", | ||
@@ -5,0 +5,0 @@ "homepage": "http://sinonjs.github.io/samsam/", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91092
24
2022