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

Function decode

packages/effect/src/Schema.ts:5833–5840  ·  view source on GitHub ↗
(transformation: {
  readonly decode: SchemaGetter.Getter<S["Type"], S["Type"], RD>
  readonly encode: SchemaGetter.Getter<S["Type"], S["Type"], RE>
})

Source from the content-addressed store, hash-verified

5831 * @since 4.0.0
5832 */
5833export function decode<S extends Constraint, RD = never, RE = never>(transformation: {
5834 readonly decode: SchemaGetter.Getter<S["Type"], S["Type"], RD>
5835 readonly encode: SchemaGetter.Getter<S["Type"], S["Type"], RE>
5836}) {
5837 return (self: S): decodeTo<toType<S>, S, RD, RE> => {
5838 return decodeTo<toType<S>, S, RD, RE>(toType(self), transformation)(self)
5839 }
5840}
5841/**
5842 * Reverses a schema transformation so the encoded schema is supplied first.
5843 *

Callers 15

decodeFromCursorFunction · 0.70
cryptoKeyFromFormatFunction · 0.70
Schema.tsFile · 0.70
makeSyncEntryFunction · 0.70
prepareSchemasFunction · 0.50
Inspector.test.tsFile · 0.50
exampleFunction · 0.50
makeHandlerFunction · 0.50
runFunction · 0.50

Calls 2

decodeToFunction · 0.70
toTypeInterface · 0.70

Tested by

no test coverage detected