MCPcopy Index your code
hub / github.com/Effect-TS/effect / pick

Function pick

packages/effect/src/internal/context.ts:312–324  ·  view source on GitHub ↗
(...tags: Tags)

Source from the content-addressed store, hash-verified

310/** @internal */
311export const pick =
312 <Tags extends ReadonlyArray<C.Tag<any, any>>>(...tags: Tags) =>
313 <Services>(self: C.Context<Services>): C.Context<
314 Services & C.Tag.Identifier<Tags[number]>
315 > => {
316 const tagSet = new Set<string>(tags.map((_) => _.key))
317 const newEnv = new Map()
318 for (const [tag, s] of self.unsafeMap.entries()) {
319 if (tagSet.has(tag)) {
320 newEnv.set(tag, s)
321 }
322 }
323 return makeContext(newEnv)
324 }
325
326/** @internal */
327export const omit =

Callers

nothing calls this directly

Calls 4

makeContextFunction · 0.85
entriesMethod · 0.80
mapMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…