(queryKey: QueryKey | MutationKey)
| 282 | * ``` |
| 283 | */ |
| 284 | export function hashKey(queryKey: QueryKey | MutationKey): string { |
| 285 | return JSON.stringify(queryKey, (_, val) => |
| 286 | isPlainObject(val) |
| 287 | ? Object.keys(val) |
| 288 | .sort() |
| 289 | .reduce((result, key) => { |
| 290 | result[key] = val[key] |
| 291 | return result |
| 292 | }, {} as any) |
| 293 | : val, |
| 294 | ) |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * Checks if key `b` partially matches with key `a`. |