MCPcopy Index your code
hub / github.com/Effect-TS/effect / Option

Function Option

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

Source from the content-addressed store, hash-verified

7224 * @since 3.10.0
7225 */
7226export function Option<Value extends Schema.Any>(value: Value): Option<Value> {
7227 const value_ = asSchema(value)
7228 const out = transform(
7229 optionEncoded(value_),
7230 OptionFromSelf(typeSchema(value_)),
7231 {
7232 strict: true,
7233 decode: (i) => optionDecode(i),
7234 encode: (a) =>
7235 option_.match(a, {
7236 onNone: () => makeNoneEncoded,
7237 onSome: makeSomeEncoded
7238 })
7239 }
7240 )
7241 return out as any
7242}
7243
7244/**
7245 * @category api interface

Callers

nothing calls this directly

Calls 6

asSchemaFunction · 0.85
optionEncodedFunction · 0.85
typeSchemaFunction · 0.85
optionDecodeFunction · 0.85
transformInterface · 0.70
OptionFromSelfFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…