MCPcopy Create free account
hub / github.com/SvelteStack/svelte-query / ensureQueryKeyArray

Function ensureQueryKeyArray

src/queryCore/core/utils.ts:94–100  ·  view source on GitHub ↗
(
  value: T
)

Source from the content-addressed store, hash-verified

92}
93
94export function ensureQueryKeyArray<T extends QueryKey>(
95 value: T
96): EnsuredQueryKey<T> {
97 return (Array.isArray(value)
98 ? value
99 : ([value] as unknown)) as EnsuredQueryKey<T>
100}
101
102export function difference<T>(array1: T[], array2: T[]): T[] {
103 return array1.filter(x => array2.indexOf(x) === -1)

Callers 3

fetchMethod · 0.90
hashQueryKeyFunction · 0.85
partialMatchKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…