@jest/expect-utils
Advanced tools
Comparing version 30.0.0-alpha.1 to 30.0.0-alpha.2
@@ -7,2 +7,3 @@ /** | ||
*/ | ||
export declare const arrayBufferEquality: ( | ||
@@ -64,5 +65,5 @@ a: unknown, | ||
export declare const partition: <T>( | ||
items: T[], | ||
items: Array<T>, | ||
predicate: (arg: T) => boolean, | ||
) => [T[], T[]]; | ||
) => [Array<T>, Array<T>]; | ||
@@ -69,0 +70,0 @@ export declare const pathAsArray: (propertyPath: string) => Array<any>; |
@@ -215,2 +215,5 @@ /*! | ||
return a.source === b.source && a.flags === b.flags; | ||
// URLs are compared by their href property which contains the entire url string. | ||
case '[object URL]': | ||
return a.href === b.href; | ||
} | ||
@@ -342,6 +345,8 @@ if (typeof a !== 'object' || typeof b !== 'object') { | ||
// Retrieves an object's keys for evaluation by getObjectSubset. This evaluates | ||
// the prototype chain for string keys but not for symbols. (Otherwise, it | ||
// could find values such as a Set or Map's Symbol.toStringTag, with unexpected | ||
// results.) | ||
const getObjectKeys = object => [...Object.keys(object), ...Object.getOwnPropertySymbols(object)]; | ||
// the prototype chain for string keys but not for non-enumerable symbols. | ||
// (Otherwise, it could find values such as a Set or Map's Symbol.toStringTag, | ||
// with unexpected results.) | ||
const getObjectKeys = object => { | ||
return [...Object.keys(object), ...Object.getOwnPropertySymbols(object).filter(s => Object.getOwnPropertyDescriptor(object, s)?.enumerable)]; | ||
}; | ||
exports.getObjectKeys = getObjectKeys; | ||
@@ -511,4 +516,4 @@ const getPath = (object, propertyPath) => { | ||
if (!(0, _immutableUtils.isImmutableList)(a) && !(0, _immutableUtils.isImmutableOrderedKeyed)(a) && !(0, _immutableUtils.isImmutableOrderedSet)(a) && !(0, _immutableUtils.isImmutableRecord)(a)) { | ||
const aEntries = Object.entries(a); | ||
const bEntries = Object.entries(b); | ||
const aEntries = entries(a); | ||
const bEntries = entries(b); | ||
if (!(0, _jasmineUtils.equals)(aEntries, bEntries)) { | ||
@@ -525,2 +530,6 @@ return false; | ||
exports.iterableEquality = iterableEquality; | ||
const entries = obj => { | ||
if (!isObject(obj)) return []; | ||
return Object.getOwnPropertySymbols(obj).filter(key => key !== Symbol.iterator).map(key => [key, obj[key]]).concat(Object.entries(obj)); | ||
}; | ||
const isObject = a => a !== null && typeof a === 'object'; | ||
@@ -527,0 +536,0 @@ const isObjectWithKeys = a => isObject(a) && !(a instanceof Error) && !(a instanceof Array) && !(a instanceof Date); |
{ | ||
"name": "@jest/expect-utils", | ||
"version": "30.0.0-alpha.1", | ||
"version": "30.0.0-alpha.2", | ||
"repository": { | ||
@@ -22,3 +22,3 @@ "type": "git", | ||
"dependencies": { | ||
"jest-get-type": "30.0.0-alpha.1" | ||
"jest-get-type": "30.0.0-alpha.2" | ||
}, | ||
@@ -28,3 +28,3 @@ "devDependencies": { | ||
"immutable": "^4.0.0", | ||
"jest-matcher-utils": "30.0.0-alpha.1", | ||
"jest-matcher-utils": "30.0.0-alpha.2", | ||
"tsd-lite": "^0.8.0" | ||
@@ -38,3 +38,3 @@ }, | ||
}, | ||
"gitHead": "d005cb2505c041583e0c5636d006e08666a54b63" | ||
"gitHead": "c04d13d7abd22e47b0997f6027886aed225c9ce4" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30738
741
0
+ Addedjest-get-type@30.0.0-alpha.2(transitive)
- Removedjest-get-type@30.0.0-alpha.1(transitive)
Updatedjest-get-type@30.0.0-alpha.2