File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -4068,7 +4068,7 @@ Assertion.addProperty('finite', function (_msg) {
40684068 *
40694069 * @param {unknown } expected
40704070 * @param {unknown } actual
4071- * @returns {void }
4071+ * @returns {boolean }
40724072 */
40734073function compareSubset ( expected , actual ) {
40744074 if ( expected === actual ) {
@@ -4104,15 +4104,19 @@ function compareSubset(expected, actual) {
41044104 }
41054105
41064106 return Object . keys ( expected ) . every ( function ( key ) {
4107- var eo = expected [ key ] ;
4108- var ao = actual [ key ] ;
4109- if ( typeof eo === 'object' && eo !== null && ao !== null ) {
4110- return compareSubset ( eo , ao ) ;
4107+ var expectedValue = expected [ key ] ;
4108+ var actualValue = actual [ key ] ;
4109+ if (
4110+ typeof expectedValue === 'object' &&
4111+ expectedValue !== null &&
4112+ actualValue !== null
4113+ ) {
4114+ return compareSubset ( expectedValue , actualValue ) ;
41114115 }
4112- if ( typeof eo === 'function' ) {
4113- return eo ( ao ) ;
4116+ if ( typeof expectedValue === 'function' ) {
4117+ return expectedValue ( actualValue ) ;
41144118 }
4115- return ao === eo ;
4119+ return actualValue === expectedValue ;
41164120 } ) ;
41174121}
41184122
You can’t perform that action at this time.
0 commit comments