Function
onNone
(
f: (options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, R>
)
Source from the content-addressed store, hash-verified
| 349 | * @since 4.0.0 |
| 350 | */ |
| 351 | export function onNone<T, E extends T = T, R = never>( |
| 352 | f: (options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, R> |
| 353 | ): Getter<T, E, R> { |
| 354 | return new Getter((ot, options) => Option.isNone(ot) ? f(options) : Effect.succeed(ot)) |
| 355 | } |
| 356 | |
| 357 | /** |
| 358 | * Creates a getter that fails with `MissingKey` if the input is absent (`Option.None`). |
Tested by
no test coverage detected