effect-io-ai

Package: effect
Module: SchemaGetter

SchemaGetter.passthroughSubtype

Returns the identity getter, typed for when the encoded type E is a subtype of T.

When to use

Use when you need a schema getter that passes values through without { strict: false } for an encoded type that narrows the decoded type.

Details

Example (Passing through subtypes)

import { SchemaGetter } from "effect"

// "hello" extends string, so E extends T
const g = SchemaGetter.passthroughSubtype<string, "hello">()

See

Signature

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

Source

Since v4.0.0