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

Function OptionFromNullOr

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

Source from the content-addressed store, hash-verified

7254 * @since 3.10.0
7255 */
7256export function OptionFromNullOr<Value extends Schema.Any>(value: Value): OptionFromNullOr<Value> {
7257 return transform(NullOr(value), OptionFromSelf(typeSchema(asSchema(value))), {
7258 strict: true,
7259 decode: (i) => option_.fromNullable(i),
7260 encode: (a) => option_.getOrNull(a)
7261 })
7262}
7263
7264/**
7265 * @category api interface

Callers

nothing calls this directly

Calls 5

typeSchemaFunction · 0.85
asSchemaFunction · 0.85
transformInterface · 0.70
NullOrFunction · 0.70
OptionFromSelfFunction · 0.70

Tested by

no test coverage detected