Skip to content

Commit 9f48750

Browse files
committed
Variable Naming and Function Doc
1 parent 8371f6c commit 9f48750

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

lib/chai/core/assertions.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff 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
*/
40734073
function 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

0 commit comments

Comments
 (0)