MCPcopy
hub / github.com/TanStack/query / partialMatchKey

Function partialMatchKey

packages/query-core/src/utils.ts:233–247  ·  view source on GitHub ↗
(a: any, b: any)

Source from the content-addressed store, hash-verified

231 */
232export function partialMatchKey(a: QueryKey, b: QueryKey): boolean
233export function partialMatchKey(a: any, b: any): boolean {
234 if (a === b) {
235 return true
236 }
237
238 if (typeof a !== typeof b) {
239 return false
240 }
241
242 if (a && b && typeof a === 'object' && typeof b === 'object') {
243 return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))
244 }
245
246 return false
247}
248
249const hasOwn = Object.prototype.hasOwnProperty
250

Callers 6

restoreQueriesFunction · 0.90
getQueryDefaultsMethod · 0.90
getMutationDefaultsMethod · 0.90
utils.test.tsxFile · 0.90
matchQueryFunction · 0.85
matchMutationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…