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

Function catchEncodingWithContext

packages/effect/src/Schema.ts:5481–5486  ·  view source on GitHub ↗
(
  f: (issue: SchemaIssue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, SchemaIssue.Issue, R>
)

Source from the content-addressed store, hash-verified

5479 * @since 4.0.0
5480 */
5481export function catchEncodingWithContext<S extends Constraint, R = never>(
5482 f: (issue: SchemaIssue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, SchemaIssue.Issue, R>
5483) {
5484 return (self: S): middlewareEncoding<S, S["EncodingServices"] | R> =>
5485 middlewareEncoding<S, S["EncodingServices"] | R>(Effect.catchEager(f))(self)
5486}
5487
5488/**
5489 * Type-level representation returned by {@link decodeTo}.

Callers 1

catchEncodingFunction · 0.85

Calls 1

middlewareEncodingFunction · 0.70

Tested by

no test coverage detected