Function
onNone
(
f: (options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, R>
)
Source from the content-addressed store, hash-verified
| 332 | * |
| 333 | * **Example** (Providing a default timestamp for a missing field) |
| 334 | * |
| 335 | * ```ts import.meta.vitest |
| 336 | * import { Effect, Option, SchemaGetter } from "effect" |
| 337 | * |
| 338 | * const withTimestamp = SchemaGetter.onNone<number>(() => |
| 339 | * Effect.succeed(Option.some(0)) |
| 340 | * ) |
| 341 | * await Effect.runPromise(withTimestamp.run(Option.none(), {})) // => Option.some(0) |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…