effect-io-ai

Package: effect
Module: SchemaTransformation

SchemaTransformation.capitalize

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

Signature

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

Source

Since v4.0.0