MCPcopy Create free account
hub / github.com/Effect-TS/effect / optionParse

Function optionParse

packages/effect/src/Schema.ts:7154–7160  ·  view source on GitHub ↗
(decodeUnknown: ParseResult.DecodeUnknown<A, R>)

Source from the content-addressed store, hash-verified

7152
7153const optionParse =
7154 <A, R>(decodeUnknown: ParseResult.DecodeUnknown<A, R>): ParseResult.DeclarationDecodeUnknown<option_.Option<A>, R> =>
7155 (u, options, ast) =>
7156 option_.isOption(u) ?
7157 option_.isNone(u) ?
7158 ParseResult.succeed(option_.none())
7159 : toComposite(decodeUnknown(u.value, options), option_.some, ast, u)
7160 : ParseResult.fail(new ParseResult.Type(ast, u))
7161
7162/**
7163 * @category api interface

Callers 1

OptionFromSelf_Function · 0.85

Calls 3

toCompositeFunction · 0.85
decodeUnknownFunction · 0.70
failMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…