Package: effect
Module: SchemaTransformation
Transforms strings by capitalizing the first character on decode. Encode is passthrough.
When to use
Use when you need a schema transformation to normalize display names or titles.
Details
Decoding uppercases the first character and leaves the rest unchanged. Encoding is passthrough.
Example (Capitalizing on decode)
import { Schema, SchemaTransformation } from "effect"
const Capitalized = Schema.String.pipe(
Schema.decode(SchemaTransformation.capitalize())
)
See
uncapitalizetoUpperCaseSignature
declare const capitalize: () => Transformation<string, string>
Since v4.0.0