@jest/expect-utils
Advanced tools
Comparing version 30.0.0-alpha.5 to 30.0.0-alpha.6
@@ -180,3 +180,3 @@ /*! | ||
if (a instanceof Error && b instanceof Error) { | ||
return a.message == b.message; | ||
return a.message === b.message; | ||
} | ||
@@ -191,3 +191,3 @@ if (Object.is(a, b)) { | ||
const className = Object.prototype.toString.call(a); | ||
if (className != Object.prototype.toString.call(b)) { | ||
if (className !== Object.prototype.toString.call(b)) { | ||
return false; | ||
@@ -213,3 +213,3 @@ } | ||
// of `NaN` are not equivalent. | ||
return +a == +b; | ||
return +a === +b; | ||
// RegExps are compared by their source patterns and flags. | ||
@@ -249,3 +249,3 @@ case '[object RegExp]': | ||
// Compare array lengths to determine if a deep comparison is necessary. | ||
if (strictCheck && className == '[object Array]' && a.length !== b.length) { | ||
if (strictCheck && className === '[object Array]' && a.length !== b.length) { | ||
return false; | ||
@@ -433,3 +433,3 @@ } | ||
aStack = [], bStack = []) => { | ||
if (typeof a !== 'object' || typeof b !== 'object' || Array.isArray(a) || Array.isArray(b) || !hasIterator(a) || !hasIterator(b)) { | ||
if (typeof a !== 'object' || typeof b !== 'object' || Array.isArray(a) || Array.isArray(b) || ArrayBuffer.isView(a) || ArrayBuffer.isView(b) || !hasIterator(a) || !hasIterator(b)) { | ||
return undefined; | ||
@@ -589,5 +589,8 @@ } | ||
let dataViewB = b; | ||
if (a instanceof ArrayBuffer && b instanceof ArrayBuffer) { | ||
if (isArrayBuffer(a) && isArrayBuffer(b)) { | ||
dataViewA = new DataView(a); | ||
dataViewB = new DataView(b); | ||
} else if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { | ||
dataViewA = new DataView(a.buffer, a.byteOffset, a.byteLength); | ||
dataViewB = new DataView(b.buffer, b.byteOffset, b.byteLength); | ||
} | ||
@@ -612,2 +615,5 @@ if (!(dataViewA instanceof DataView && dataViewB instanceof DataView)) { | ||
exports.arrayBufferEquality = arrayBufferEquality; | ||
function isArrayBuffer(obj) { | ||
return Object.prototype.toString.call(obj) === '[object ArrayBuffer]'; | ||
} | ||
const sparseArrayEquality = (a, b, customTesters = []) => { | ||
@@ -614,0 +620,0 @@ if (!Array.isArray(a) || !Array.isArray(b)) { |
{ | ||
"name": "@jest/expect-utils", | ||
"version": "30.0.0-alpha.5", | ||
"version": "30.0.0-alpha.6", | ||
"repository": { | ||
@@ -22,7 +22,7 @@ "type": "git", | ||
"dependencies": { | ||
"jest-get-type": "30.0.0-alpha.5" | ||
"jest-get-type": "30.0.0-alpha.6" | ||
}, | ||
"devDependencies": { | ||
"immutable": "^4.0.0", | ||
"jest-matcher-utils": "30.0.0-alpha.5" | ||
"jest-matcher-utils": "30.0.0-alpha.6" | ||
}, | ||
@@ -35,3 +35,3 @@ "engines": { | ||
}, | ||
"gitHead": "fa24a3bdd6682978d76799265016fb9d5bff135e" | ||
"gitHead": "ba74b7de1b9cca88daf33f9d1b46bfe2b7f485a5" | ||
} |
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
31241
751
+ Addedjest-get-type@30.0.0-alpha.6(transitive)
- Removedjest-get-type@30.0.0-alpha.5(transitive)
Updatedjest-get-type@30.0.0-alpha.6