Package: effect
Module: SchemaTransformation
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
toUpperCasetrimSignature
declare const toLowerCase: () => Transformation<string, string>
Since v4.0.0