effect-io-ai

Package: effect
Module: SchemaTransformation

SchemaTransformation.passthroughSubtype

Transforms values without changing them, typed so that E extends T — the encoded type is a subtype of the decoded type.

When to use

Use when you need a no-op schema transformation whose encoded side is more specific than its decoded side.

Details

Example (Passing through subtypes)

import { SchemaTransformation } from "effect"

const t = SchemaTransformation.passthroughSubtype<string, "a" | "b">()

See

Signature

declare const passthroughSubtype: <T, E extends T>() => Transformation<T, E>

Source

Since v4.0.0