MCPcopy
hub / github.com/Effect-TS/effect / OptionFromUndefinedOr

Function OptionFromUndefinedOr

packages/effect/src/Schema.ts:7305–7311  ·  view source on GitHub ↗
(value: Value)

Source from the content-addressed store, hash-verified

7303 * @since 3.10.0
7304 */
7305export function OptionFromUndefinedOr<Value extends Schema.Any>(value: Value): OptionFromUndefinedOr<Value> {
7306 return transform(UndefinedOr(value), OptionFromSelf(typeSchema(asSchema(value))), {
7307 strict: true,
7308 decode: (i) => option_.fromNullable(i),
7309 encode: (a) => option_.getOrUndefined(a)
7310 })
7311}
7312
7313/**
7314 * Transforms strings into an Option type, effectively filtering out empty or

Callers

nothing calls this directly

Calls 5

typeSchemaFunction · 0.85
asSchemaFunction · 0.85
transformInterface · 0.70
UndefinedOrFunction · 0.70
OptionFromSelfFunction · 0.70

Tested by

no test coverage detected