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

Method key

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

* Focuses on a property of the current struct/tuple focus. * * **Details** * * - On a Lens, returns a Lens. * - On an Optional, returns an Optional. * - Does **not** work on union types (compile error). * * **Example** (Drilling into nested structs) * *

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

Source from the content-addressed store, hash-verified

521 * ```
522 */
523 key<S, A extends object, Key extends keyof A>(
524 this: Lens<S, A>,
525 key: Key,
526 ..._err: ForbidUnion<A, "cannot use `key` on a union type">

Callers 5

optic.tsFile · 0.65
Optic.tst.tsFile · 0.65
Optic.tsFile · 0.65
Optic.test.tsFile · 0.65
toIso.test.tsFile · 0.65

Implementers 1

OptionalImplpackages/effect/src/Optic.ts

Calls

no outgoing calls

Tested by

no test coverage detected