Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

partialMatchKey.md

33 lines611 Bytes

1---
2id: partialMatchKey
3title: partialMatchKey
4---
5​
6```ts
7function partialMatchKey(a: readonly unknown[], b: readonly unknown[]): boolean;
8```
9​
10Defined in: [packages/query-core/src/utils.ts:343](https://github.com/TanStack/query/blob/main/packages/query-core/src/utils.ts#L343)
11​
12Checks if key `b` partially matches with key `a`.
13​
14## Parameters
15​
16### a
17​
18readonly `unknown`[]
19​
20The key to check, e.g. a query's own key.
21​
22### b
23​
24readonly `unknown`[]
25​
26The (partial) key to match against `a`.
27​
28## Returns
29​
30`boolean`
31​
32`true` if every array element or object property in `b` matches the one at the same
33position in `a`.