(a: any, b: any)
| 247 | */ |
| 248 | export function partialMatchKey(a: QueryKey, b: QueryKey): boolean |
| 249 | export function partialMatchKey(a: any, b: any): boolean { |
| 250 | if (a === b) { |
| 251 | return true |
| 252 | } |
| 253 | |
| 254 | if (typeof a !== typeof b) { |
| 255 | return false |
| 256 | } |
| 257 | |
| 258 | if (a && b && typeof a === 'object' && typeof b === 'object') { |
| 259 | if (Array.isArray(a) && Array.isArray(b)) { |
| 260 | for (let i = 0; i < b.length; i++) { |
| 261 | if (!partialMatchKey(a[i], b[i])) { |
| 262 | return false |
| 263 | } |
| 264 | } |
| 265 | return true |
| 266 | } |
| 267 | |
| 268 | const bKeys = Object.keys(b) |
| 269 | for (const key of bKeys) { |
| 270 | if (!partialMatchKey(a[key], b[key])) { |
| 271 | return false |
| 272 | } |
| 273 | } |
| 274 | return true |
| 275 | } |
| 276 | |
| 277 | return false |
| 278 | } |
| 279 | |
| 280 | const hasOwn = Object.prototype.hasOwnProperty |
| 281 |
no outgoing calls
no test coverage detected