effect-io-ai

Package: effect
Module: SchemaTransformation

SchemaTransformation.toLowerCase

Transforms strings by lowercasing on decode. Encode is passthrough.

When to use

Use when you need a schema transformation to normalize strings to lowercase (e.g. email addresses).

Details

Decoding applies String.prototype.toLowerCase(). Encoding is passthrough. This is not round-trippable if the original had uppercase characters.

Example (Lowercasing on decode)

import { Schema, SchemaTransformation } from "effect"

const Lowered = Schema.String.pipe(
  Schema.decode(SchemaTransformation.toLowerCase())
)

See

Signature

declare const toLowerCase: () => Transformation<string, string>

Source

Since v4.0.0