MCPcopy Create free account
hub / github.com/effect-app/libs / normalizeKey

Function normalizeKey

packages/effect-app/src/rpc/Invalidation.ts:16–20  ·  view source on GitHub ↗
(input: InvalidationKeyInput)

Source from the content-addressed store, hash-verified

14export type InvalidationKeyInput = InvalidationKey | { readonly id: string; readonly options?: ClientForOptions }
15
16const normalizeKey = (input: InvalidationKeyInput): InvalidationKey => {
17 if (Array.isArray(input)) return input
18 const handler = input as { id: string; options?: ClientForOptions }
19 return makeQueryKey(handler.options ? { id: handler.id, options: handler.options } : { id: handler.id })
20}
21
22// Disambiguates `add` overloads: a `string[]` means a single key; an array
23// containing arrays-or-objects means a batch of inputs.

Callers 1

normalizeInputsFunction · 0.85

Calls 1

makeQueryKeyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…