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

Function toIssueEffect

packages/effect/src/Schema.ts:6036–6043  ·  view source on GitHub ↗
(
  self: Effect.Effect<A, SchemaError, R>
)

Source from the content-addressed store, hash-verified

6034}
6035
6036function toIssueEffect<A, R>(
6037 self: Effect.Effect<A, SchemaError, R>
6038): Effect.Effect<A, SchemaIssue.Issue, R> {
6039 if (effectIsExit(self) && self._tag === "Success") {
6040 return self as unknown as Exit_.Exit<A, SchemaIssue.Issue>
6041 }
6042 return Effect.catchCause(self, (cause) => Effect.failCauseSync(() => Cause_.map(cause, (error) => error.issue)))
6043}
6044/**
6045 * Makes a struct key optional on the `Encoded` side and provides a default
6046 * `Encoded` value when the key is missing during decoding.

Callers 2

withDecodingDefaultKeyFunction · 0.85
withDecodingDefaultFunction · 0.85

Calls 2

effectIsExitFunction · 0.90
mapMethod · 0.45

Tested by

no test coverage detected