effect-io-ai

Package: effect
Module: SchemaTransformation

SchemaTransformation.passthrough

Transforms values by returning the input unchanged in both directions.

When to use

Use when you need a schema transformation to connect two schemas that share the same type with no actual conversion.

Details

Example (Chaining schemas with no conversion)

import { Schema, SchemaTransformation } from "effect"

const schema = Schema.Trim.pipe(
  Schema.decodeTo(Schema.FiniteFromString, SchemaTransformation.passthrough())
)

See

Signature

declare const passthrough: { <T, E>(options: { readonly strict: false; }): Transformation<T, E>; <T>(): Transformation<T, T>; }

Source

Since v4.0.0