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

Function eitherParse

packages/effect/src/Schema.ts:7402–7412  ·  view source on GitHub ↗
(
  parseRight: ParseResult.DecodeUnknown<R, RR>,
  decodeUnknownLeft: ParseResult.DecodeUnknown<L, LR>
)

Source from the content-addressed store, hash-verified

7400 })
7401
7402const eitherParse = <RR, R, LR, L>(
7403 parseRight: ParseResult.DecodeUnknown<R, RR>,
7404 decodeUnknownLeft: ParseResult.DecodeUnknown<L, LR>
7405): ParseResult.DeclarationDecodeUnknown<either_.Either<R, L>, LR | RR> =>
7406(u, options, ast) =>
7407 either_.isEither(u) ?
7408 either_.match(u, {
7409 onLeft: (left) => toComposite(decodeUnknownLeft(left, options), either_.left, ast, u),
7410 onRight: (right) => toComposite(parseRight(right, options), either_.right, ast, u)
7411 })
7412 : ParseResult.fail(new ParseResult.Type(ast, u))
7413
7414/**
7415 * @category api interface

Callers 1

EitherFromSelfFunction · 0.85

Calls 2

toCompositeFunction · 0.85
failMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…