Package: effect
Module: SchemaGetter
Returns the identity getter — passes the value through unchanged.
When to use
Use when you need a schema getter for one side of a decodeTo pair, either
encode or decode, to pass values through unchanged.
Details
.compose() — composing with a passthrough is free.T === E. Pass { strict: false } to opt
out of the type constraint.Example (Passing through identity transformations)
import { Schema, SchemaGetter } from "effect"
// No transformation needed — types already match
const StringToString = Schema.String.pipe(
Schema.decodeTo(Schema.String, {
decode: SchemaGetter.passthrough(),
encode: SchemaGetter.passthrough()
})
)
See
passthroughSupertype when T extends EpassthroughSubtype when E extends Ttransform when you need to change the valueSignature
declare const passthrough: { <T, E>(options: { readonly strict: false; }): Getter<T, E>; <T>(): Getter<T, T>; }
Since v4.0.0