MCPcopy Create free account
hub / github.com/Effect-TS/effect / targetsHit

Function targetsHit

packages/effect/src/ui/Query.ts:2936–2949  ·  view source on GitHub ↗
(
  targets: Targets,
  name: string,
  tags: ReadonlyArray<string> | undefined,
  argsKey: string
)

Source from the content-addressed store, hash-verified

2934 * hydrated entry, whose read the cache hasn't seen: every tag hits it.
2935 */
2936const targetsHit = (
2937 targets: Targets,
2938 name: string,
2939 tags: ReadonlyArray<string> | undefined,
2940 argsKey: string
2941): boolean => {
2942 if (
2943 targets.queries.has(name) ||
2944 targets.entries.get(name)?.has(argsKey) === true
2945 ) return true
2946 if (targets.tags.size === 0) return false
2947 if (tags === undefined) return true
2948 return tags.some((tag) => targets.tags.has(tag))
2949}
2950
2951/**
2952 * Applies one patch to a value of the entry of `name` at `argsKey`. A patch

Callers 5

invalidatesEntryFunction · 0.85
resolveFunction · 0.85
applyWritesFunction · 0.85
reopenedFunction · 0.85
beginRunFunction · 0.85

Calls 3

someMethod · 0.80
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected