@tanstack/query-core
Advanced tools
Comparing version 5.17.14 to 5.17.15
@@ -108,3 +108,4 @@ import "./chunk-2HYBKCYP.js"; | ||
if (array || isPlainObject(a) && isPlainObject(b)) { | ||
const aSize = array ? a.length : Object.keys(a).length; | ||
const aItems = array ? a : Object.keys(a); | ||
const aSize = aItems.length; | ||
const bItems = array ? b : Object.keys(b); | ||
@@ -116,5 +117,10 @@ const bSize = bItems.length; | ||
const key = array ? i : bItems[i]; | ||
copy[key] = replaceEqualDeep(a[key], b[key]); | ||
if (copy[key] === a[key] && a[key] !== void 0) { | ||
if (!array && a[key] === void 0 && b[key] === void 0 && aItems.includes(key)) { | ||
copy[key] = void 0; | ||
equalItems++; | ||
} else { | ||
copy[key] = replaceEqualDeep(a[key], b[key]); | ||
if (copy[key] === a[key] && a[key] !== void 0) { | ||
equalItems++; | ||
} | ||
} | ||
@@ -121,0 +127,0 @@ } |
@@ -106,3 +106,4 @@ // src/utils.ts | ||
if (array || isPlainObject(a) && isPlainObject(b)) { | ||
const aSize = array ? a.length : Object.keys(a).length; | ||
const aItems = array ? a : Object.keys(a); | ||
const aSize = aItems.length; | ||
const bItems = array ? b : Object.keys(b); | ||
@@ -114,5 +115,10 @@ const bSize = bItems.length; | ||
const key = array ? i : bItems[i]; | ||
copy[key] = replaceEqualDeep(a[key], b[key]); | ||
if (copy[key] === a[key] && a[key] !== void 0) { | ||
if (!array && a[key] === void 0 && b[key] === void 0 && aItems.includes(key)) { | ||
copy[key] = void 0; | ||
equalItems++; | ||
} else { | ||
copy[key] = replaceEqualDeep(a[key], b[key]); | ||
if (copy[key] === a[key] && a[key] !== void 0) { | ||
equalItems++; | ||
} | ||
} | ||
@@ -119,0 +125,0 @@ } |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "5.17.14", | ||
"version": "5.17.15", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -227,3 +227,4 @@ import type { Mutation } from './mutation' | ||
if (array || (isPlainObject(a) && isPlainObject(b))) { | ||
const aSize = array ? a.length : Object.keys(a).length | ||
const aItems = array ? a : Object.keys(a) | ||
const aSize = aItems.length | ||
const bItems = array ? b : Object.keys(b) | ||
@@ -237,5 +238,15 @@ const bSize = bItems.length | ||
const key = array ? i : bItems[i] | ||
copy[key] = replaceEqualDeep(a[key], b[key]) | ||
if (copy[key] === a[key] && a[key] !== undefined) { | ||
if ( | ||
!array && | ||
a[key] === undefined && | ||
b[key] === undefined && | ||
aItems.includes(key) | ||
) { | ||
copy[key] = undefined | ||
equalItems++ | ||
} else { | ||
copy[key] = replaceEqualDeep(a[key], b[key]) | ||
if (copy[key] === a[key] && a[key] !== undefined) { | ||
equalItems++ | ||
} | ||
} | ||
@@ -242,0 +253,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1813457
25783