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

Method at

packages/effect/src/Optic.ts:703–703  ·  view source on GitHub ↗

* Focuses on a key only if it exists (`Object.hasOwn`). Both * `getResult` and `replaceResult` fail when the key is absent. * * **Details** * * Unlike `.key()`, which always succeeds on the read side, `.at()` is * useful for Records or arrays where the key/index may not be present.

(
    this: Optional<S, A>,
    key: Key,
    ..._err: ForbidUnion<A, "cannot use `at` on a union type">
  )

Source from the content-addressed store, hash-verified

701 * @see `.key()` — when the key is always present
702 */
703 at<S, A extends object, Key extends keyof A>(
704 this: Optional<S, A>,
705 key: Key,
706 ..._err: ForbidUnion<A, "cannot use `at` on a union type">

Callers 15

collectReferenceKeysFunction · 0.65
parseCoreJSDocFunction · 0.65
parseSectionFunction · 0.65
parseExampleFunction · 0.65
pathNameFunction · 0.65
groupNameFunction · 0.65
groupSimilarityFunction · 0.65
displayApiIdFunction · 0.65
toChatMessagesFunction · 0.65
Optic.tst.tsFile · 0.65

Implementers 1

OptionalImplpackages/effect/src/Optic.ts

Calls

no outgoing calls

Tested by 1

assertFilterReviverFunction · 0.52