MCPcopy Create free account
hub / github.com/effect-app/libs / withDecodingDefaultKey

Function withDecodingDefaultKey

repos/effect/packages/effect/src/Schema.ts:5711–5722  ·  view source on GitHub ↗
(
  defaultValue: Effect.Effect<S["Encoded"], SchemaError, R>,
  options?: DecodingDefaultOptions
)

Source from the content-addressed store, hash-verified

5709 readonly decode: SchemaGetter.Getter<From["Encoded"], To["Type"], RD>
5710 readonly encode: SchemaGetter.Getter<To["Type"], From["Encoded"], RE>
5711 }
5712) {
5713 return (from: From): decodeTo<From, To, RD, RE> => {
5714 return transformation ?
5715 decodeTo<From, To, RD, RE>(from, transformation)(to) :
5716 decodeTo<From>(from)(to)
5717 }
5718}
5719
5720/**
5721 * Applies a transformation to a schema's encoded type, creating a new schema where encoding/decoding
5722 * operate on `S["Encoded"]` rather than `S["Type"]`.
5723 *
5724 * **Details**
5725 *

Callers 2

tagDefaultOmitFunction · 0.70

Calls 5

toEncodedInterface · 0.85
optionalKeyInterface · 0.70
decodeToFunction · 0.70
omitMethod · 0.65
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…