* Focuses on a key where setting `undefined` **removes** the key from the * struct (or splices the element from an array/tuple). * * **Details** * * - The focus type becomes `A[Key] | undefined`. * - Does **not** work on union types (compile error). * * **Example** (Deleting
(
this: Lens<S, A>,
key: Key,
..._err: ForbidUnion<A, "cannot use `optionalKey` on a union type">
)
| 554 | * ``` |
| 555 | */ |
| 556 | optionalKey<S, A extends object, Key extends keyof A>( |
| 557 | this: Lens<S, A>, |
| 558 | key: Key, |
| 559 | ..._err: ForbidUnion<A, "cannot use `optionalKey` on a union type"> |
no outgoing calls