(queryKey: QueryKey | MutationKey)
| 321 | * ``` |
| 322 | */ |
| 323 | export function hashKey(queryKey: QueryKey | MutationKey): string { |
| 324 | return JSON.stringify(queryKey, (_, val) => |
| 325 | isPlainObject(val) |
| 326 | ? Object.keys(val) |
| 327 | .sort() |
| 328 | .reduce((result, key) => { |
| 329 | result[key] = val[key] |
| 330 | return result |
| 331 | }, {} as any) |
| 332 | : val, |
| 333 | ) |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * Checks if key `b` partially matches with key `a`. |