(a: any, b: any)
| 299 | */ |
| 300 | export function partialMatchKey(a: QueryKey, b: QueryKey): boolean |
| 301 | export function partialMatchKey(a: any, b: any): boolean { |
| 302 | if (a === b) { |
| 303 | return true |
| 304 | } |
| 305 | |
| 306 | if (typeof a !== typeof b) { |
| 307 | return false |
| 308 | } |
| 309 | |
| 310 | if (a && b && typeof a === 'object' && typeof b === 'object') { |
| 311 | if (Array.isArray(a) && Array.isArray(b)) { |
| 312 | if (b.length > a.length) return false |
| 313 | for (let i = 0; i < b.length; i++) { |
| 314 | if (!partialMatchKey(a[i], b[i])) { |
| 315 | return false |
| 316 | } |
| 317 | } |
| 318 | return true |
| 319 | } |
| 320 | |
| 321 | const bKeys = Object.keys(b) |
| 322 | for (const key of bKeys) { |
| 323 | if (!partialMatchKey(a[key], b[key])) { |
| 324 | return false |
| 325 | } |
| 326 | } |
| 327 | return true |
| 328 | } |
| 329 | |
| 330 | return false |
| 331 | } |
| 332 | |
| 333 | const hasOwn = Object.prototype.hasOwnProperty |
| 334 |
no outgoing calls
no test coverage detected