(a: Node, b: Node)
| 438 | * |
| 439 | * @see {@link makeOptional} — constructor |
| 440 | * @see {@link Lens} — when reading always succeeds |
| 441 | * @see {@link Prism} — when writing always succeeds |
| 442 | * |
| 443 | * @category models |
| 444 | * @since 4.0.0 |
| 445 | */ |
| 446 | export interface Optional<in out S, in out A> { |
| 447 | /** |
| 448 | * Attempts to read the focus `A` from the whole `S`. Returns |
| 449 | * `Result.Success<A>` when the focus exists, or |
| 450 | * `Result.Failure<SchemaIssue.Issue>` with a structured issue otherwise. |
| 451 | */ |
| 452 | readonly getResult: (s: S) => Result.Result<A, SchemaIssue.Issue> |
| 453 | /** |
| 454 | * Replaces the focus in `S` with a new `A`. Returns the original `s` |
| 455 | * unchanged when the optic cannot focus (never throws). |
| 456 | */ |
no test coverage detected
searching dependent graphs…